1nickt has asked for the wisdom of the Perl Monks concerning the following question:
Learned brethren,
I have installed Selenium::Firefox on my linux machine. I have also installed the Firefox browser, geckodriver binary and Xvfb so Firefox can run pseudo-headlessly and a Selenium server is not required. I am trying to run the simplest test script:
The module appears to behave as documented in so far as it finds and launches the relevant binaries, according to the process table:use strict; use warnings; use feature 'say'; use Carp::Always; use Selenium::Firefox; my $driver = Selenium::Firefox->new; say 'Binary mode: ' . $driver->binary_mode; $driver->get('http://www.google.com'); say $driver->get_title; $driver->shutdown_binary; __END__
But it just hangs then throws an exception when I run it with:vagrant 1885 00:03 /usr/local/sbin/geckodriver --port 9090 --m +arionette-port 2828 --binary /usr/lib/firefox/firefox.sh vagrant 1890 00:02 /usr/lib/firefox/firefox --marionette --pro +file /tmp/rust_mozprofile.Bezoxqxkgze8 vagrant 1933 00:01 /usr/lib/firefox/plugin-container -greomni +/usr/lib/firefox/omni.ja -appomni /usr/lib/firefox/browser/omni.ja -a +ppdir /usr/lib/firefox/browser 1890 true tab
I get the following error:DISPLAY=:42 perl test/selenium.pl
Working back using the stack trace as a map I found that the code for creating a session in Selenium::Remote::Driver is executed regardless of condition from within BUILD. I can't see any place where that is overridden by the class that extends it (Selenium::Firefox), even though use of that class should by definition rule out a session with the Selenium server.Could not create new session: at .../lib/perl5/Selenium/Remote/Driver +.pm line 428.
if ($self->has_desired_capabilities) { $self->new_desired_session( $self->desired_capabilities ); } else { # Connect to remote server & establish a new session $self->new_session( $self->extra_capabilities ); }
I confess I am a bit lost a this point. Thanks for any tips!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Selenium::Firefox (on Linux): create session error, but why? (SOLVED)
by 1nickt (Canon) on Mar 28, 2017 at 14:02 UTC |