Perlchaoui has asked for the wisdom of the Perl Monks concerning the following question:
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Recover Excel datas
by Corion (Patriarch) on Nov 14, 2018 at 13:49 UTC | |
by Perlchaoui (Sexton) on Nov 14, 2018 at 14:13 UTC | |
by marto (Cardinal) on Nov 14, 2018 at 14:22 UTC | |
by Perlchaoui (Sexton) on Nov 14, 2018 at 14:29 UTC | |
|
Re: Recover Excel datas
by bliako (Abbot) on Nov 14, 2018 at 16:34 UTC | |
by Perlchaoui (Sexton) on Nov 15, 2018 at 11:01 UTC | |
|
Re: Recover Excel datas
by marto (Cardinal) on Nov 14, 2018 at 13:52 UTC | |
by Perlchaoui (Sexton) on Nov 14, 2018 at 14:16 UTC | |
by marto (Cardinal) on Nov 14, 2018 at 14:25 UTC | |
by Perlchaoui (Sexton) on Nov 14, 2018 at 14:57 UTC | |
by marto (Cardinal) on Nov 14, 2018 at 15:58 UTC | |
| |
by Corion (Patriarch) on Nov 14, 2018 at 14:18 UTC | |
by 1nickt (Canon) on Nov 14, 2018 at 14:30 UTC | |
by Perlchaoui (Sexton) on Nov 14, 2018 at 15:00 UTC |