Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^3: Simple code using Selenium::Remote::Driver

by davies (Prior)
on Nov 08, 2018 at 13:25 UTC ( [id://1225414]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Simple code using Selenium::Remote::Driver
in thread Simple code using Selenium::Remote::Driver

IE is the hardest browser to get working with Selenium. You will need a driver, available from http://selenium-release.storage.googleapis.com/index.html?path=3.3/, but even with that, I failed. And I tried hard. If you really must use a MS browser, I was able to get Edge working and I understand that it is now MS's recommendation. The Edge driver is available from https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/.

Do i need to install a webdriver for Firefox or I.E ? - Yes, different drivers for each.

I'm really lost because i though i just have to use module Selenium::Remote::Driver - No, S::R::D on its own is very rarely enough.

Regards,

John Davies

  • Comment on Re^3: Simple code using Selenium::Remote::Driver

Replies are listed 'Best First'.
Re^4: Simple code using Selenium::Remote::Driver
by Perlchaoui (Sexton) on Nov 08, 2018 at 14:34 UTC

    Thanks John. I can imagine you are busy so thank you, appreciated.

    ok; i decided to follow you advice and avoid to use I.E. But as i am still on Win 7 i decided to test with Chrome browser instead of Edge.

    Here is the code

    #!/usr/bin/perl use strict; use warnings; use Test::More; #use Test::Time; use Selenium::Remote::Driver; my $driver = Selenium::Remote::Driver->new( 'remote_server_addr' => 'localhost', 'browser_name' => 'chrome', 'port' => '4444', ); $driver->get('http://www.google.com');
    But i got almost the same issue ,as follows :
    C:\Users\Documents\TESTPERL>perl TEST.pl Could not create new session: Unable to create new service: ChromeDriv +erService Build info: version: '3.14.0', revision: 'aacccce0', time: '2018-08-02 +T20:13:22.693Z' System info: host: 'LBNL13608', ip: '10.132.5.117', os.name: 'Windows +7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_191' Driver info: driver.version: unknown at TEST.pl line 9.

    I launched the chrome webdriver and standalone Selenium server is up and running on port 4444. Maybe it's coming from the location. Because i already added the current location in my %PATH% and as you can see it's not working

      use strict; use warnings; use feature 'say'; use Selenium::Chrome; my $url = 'http://www.perlmonks.org'; my $driver = Selenium::Chrome->new(); $driver->get($url); say $driver->get_title(); $driver->quit();

      This works for me, provided that chromedriver is in my path and that everything is up to date. You will get problems if versions are mismatched. Using Win10, I have S::R::D 1.30, chromedriver 2.43.600210 and Chrome 70.0.3538.77.

      Hope this helps.

      Regards,

      John Davies

        Thank you very much John for your time and the support

        I finally found what was going wrong

        I had to use chromedriver in conjunction with Selenium server, with the following command:

        java -Dwebdriver.chrome.driver=path -jar selenium-server-standalone-2. +33.0.jar

        That's why my code wasn't running

        I begin to loove Perl ! :)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1225414]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (5)
As of 2024-04-18 14:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found