Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Selenium::Remote::Driver doesnt work but Selenium::Firefox does #487

Open
davewood opened this issue Jul 5, 2023 · 3 comments
Open

Selenium::Remote::Driver doesnt work but Selenium::Firefox does #487

davewood opened this issue Jul 5, 2023 · 3 comments

Comments

@davewood
Copy link

davewood commented Jul 5, 2023

im using this module with firefox running inside this official container -> https://hub.docker.com/r/selenium/standalone-firefox

BEFORE

this used to work but doesnt anymore

use Selenium::Remote::Driver;
my $driver = Selenium::Remote::Driver->new(
    remote_server_addr => 'epplication-selenium',
    port => 4444,
);
$driver->get('http://www.metacpan.org');
print $driver->get_title();

AFTER

after updating the container im getting the following error message

Could not create new session: Server returned error message read timeout at /home/epplication/EPPlication/local/lib/perl5/Net/HTTP/Methods.pm line 274.
 instead of data at lib/sel.pl line 7.

However, if I use Selenium::Firefox instead of Selenium::Remote::Driver, like so

use Selenium::Firefox;
my $driver = Selenium::Firefox->new(
    remote_server_addr => 'epplication-selenium',
    port => 4444,
);
$driver->get('http://www.metacpan.org');
print $driver->get_title();

it works and prints this output on STDOUT

Search the CPAN - metacpan.org

I didnt find information what the difference is. and also no feedback from the code that gives insight.

@teodesian
Copy link
Owner

The docker container uses Selenium Grid Server 4.9.0.

Selenium 4 breaks the connection code and has for quite some time. I'm halfway thru making the necessary adjustments but had to put it down for the last few months.

Using firefox directly works, because geckodriver hasn't ripped out the Selenium 3 code yet. Nor has chromedriver.

Selenium::Client can and does work with S4, but as mentioned I haven't replaced the backend code with that yet; S::R::D has quite a bit of baggage. Namely that the new standard has no analogue for many Selenium 2 and 3 commands, and will need polyfills.

@davewood
Copy link
Author

davewood commented Jul 6, 2023

Thank you for clearing things up for me and also for the effort you've put into this module. Its one of the pieces of software that added alot of value to my own work.

Feel free to close this issue.

@teodesian
Copy link
Owner

teodesian commented Feb 22, 2024

Update on this -- I've released an early version of a S::R::D drop-in replacement as part of Selenium::Client -- Selenium::Client::Driver.

The plan going forward is to try and integrate this into S::R::D itself in the event we detect S4 servers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants