Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

Simple code using Selenium::Remote::Driver

by Perlchaoui (Sexton)
on Nov 08, 2018 at 09:20 UTC ( #1225398=perlquestion: print w/replies, xml ) Need Help??
Perlchaoui has asked for the wisdom of the Perl Monks concerning the following question:

Hi monks !

I am requesting for your widsom guys. I am a beginner in Perl . This is the first time i use Perl language. I have to do some automation regarding some tests cases and i decided to use Perl because i had good feedback of using Perl in test automation. I am working with Selenium and i decided to use Selenium::Remote::Driver I think i did all the configurations as requested but i am facing an issue wen i want to run a simple script using this module.

Here is the code
#!/usr/bin/perl use strict; use warnings; #use Selenium::Firefox; use Selenium::Remote::Driver; my $driver = Selenium::Remote::Driver->new; $driver->get(''); use Selenium::Remote::Driver;
and below the output when i launch my script from CMD:
C:\Users\user1\Documents\TESTPERL>perl Could not create new session: Unable to create new service: GeckoDrive +rService Build info: version: '3.14.0', revision: 'aacccce0', time: '2018-08-02 +T20:13:22.693Z' System info: host: 'LBNL13608', ip: '', 'Windows +7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_191' Driver info: driver.version: unknown at line 8.

I don't understand why i have to use a "geckoDriver"?!

Thanks in advance,


Replies are listed 'Best First'.
Re: Simple code using Selenium::Remote::Driver
by davies (Prior) on Nov 08, 2018 at 11:23 UTC

    Oversimplification: Firefox has an interface that is unlike other browsers. Geckodriver is the tool that converts commands and data between the format Firefox understands and the format Selenium understands. So yes, you need it. And note that the same applies to some other browsers like Edge, although obviously a different driver is needed.


    John Davies

      Many thanks John

      Ok i understand but i don't want to work with Firefox but I.E. As you can see i didn't call any instance of Firefox in my code.

      Do i need to install a webdriver for Firefox or I.E ? I'm really lost because i though i just have to use module Selenium::Remote::Driver.

      I am sorry to disturb with this issue but the informations regarding how to configure Selenium with Perl webdriver are really rares

Re: Simple code using Selenium::Remote::Driver
by LanX (Archbishop) on Nov 08, 2018 at 10:46 UTC
    I noticed that you are using the module twice in your code

    use Selenium::Remote::Driver;

    not sure if it's related to your problem.

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    Wikisyntax for the Monastery FootballPerl is like chess, only without the dice

      Thanks @LanX

      It is just a duplicate; when i did a copy/paste. I change that in the query

      But this is not the issue . Can someone bring a clarification on this concern please?

Re: Simple code using Selenium::Remote::Driver
by bliako (Deacon) on Nov 08, 2018 at 16:38 UTC
    Driver info: driver.version: unknown at line 9.

    Is the webdriver found at all? It looks like it is not. Or if it is found on disk, then some binary incompatibility may stop it from reading in even its version.

    In this link : there is a one-liner to launch selenium and chrome via java. Try it but most likely it fails too.

      Thanks Bliako

      Exactly. The issue was coming from the webdriver itself

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

      java -jar selenium-server-standalone-2. +33.0.jar

      That's why my code wasn't running

      Again, thank you for the support

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1225398]
Approved by marto
Front-paged by Corion
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (5)
As of 2019-01-16 03:36 GMT
Find Nodes?
    Voting Booth?
    After Perl5, I'm mostly interested in:

    Results (274 votes). Check out past polls.