Hello dear Monastery
I am trying to automate the navigation within a website using an Excel file as data set. I am using Selenium::Remote::Driver as module. When i am trying to recover datas from , for instance, cell B1, i am getting an error related to the use of a "url" but nor in my script or in my Excel config file i am using an URL . So i really don't understand this issue..
Here the code
#!/usr/bin/perl use strict; use warnings; use Test::More; #use Test::Time; use Selenium::Remote::Driver; use Selenium::Remote::WebElement; use Selenium::Remote::WDKeys; use Spreadsheet::Read; use Text::CSV_XS; my $driver = Selenium::Remote::Driver->new( 'remote_server_addr' => 'localhost', 'browser_name' => 'chrome', 'port' => '4444', ); my $excel = ReadData ("SOGETI.csv"); my $data = $excel->[1]{B1}; $driver->get('http://www.google.com'); $driver->get($data); $driver->maximize_window(); $driver->find_element('q','name')->send_keys($data); $driver->pause(4000); my $filename = "screenshot.png"; $driver->capture_screenshot($filename); $driver->pause(2000); ok($driver->get_title =~ /Google/,"title matches google"); is($driver->get_title,'Google',"Title is google"); ok($driver->get_title eq 'Google','Title equals google'); like($driver->get_title,qr/Google/,"Title matches google"); $driver->quit();
And below the output in my console
C:\Users\User1\Documents\TESTPERL>perl TEST.pl Error while executing command: invalid argument: 'url' must be a strin +g (Session info: chrome=70.0.3538.77) (Driver info: chromedriver=2.43.600210 (68dcf5eebde37173d4027fa8635e +332711d2874a),platform=Windows NT 6.1.7601 SP1 x86_64) at C:/Strawber +ry/perl/site/lib/Selenium/Remot e/Driver.pm line 391. at C:/Strawberry/perl/site/lib/Selenium/Remote/Driver.pm line 348.
Is someone able to have a look to this issue please ?
Thanks in advance
In reply to Recover Excel datas by Perlchaoui
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |