teodesian / Selenium-Remote-Driver

Perl Bindings to the Selenium Webdriver server
174 stars 90 forks source link

Selenium::Firefox ... You need to specify a browser or driver #488

Open davewood opened 1 year ago

davewood commented 1 year ago

things keep changing and breaking my working setup and im trying to figure out the most recent change.

this is my selenium service, running in a container (image: selenium/standalone-firefox)

epplication-selenium | Selenium Grid Standalone configuration:
epplication-selenium | [network]
epplication-selenium | relax-checks = true
epplication-selenium |
epplication-selenium | [node]
epplication-selenium | session-timeout = "300"
epplication-selenium | override-max-sessions = false
epplication-selenium | detect-drivers = false
epplication-selenium | drain-after-session-count = 0
epplication-selenium | max-sessions = 1
epplication-selenium |
epplication-selenium | [[node.driver-configuration]]
epplication-selenium | display-name = "firefox"
epplication-selenium | stereotype = '{"browserName": "firefox", "browserVersion": "117.0", "platformName": "Linux"}'
epplication-selenium | max-sessions = 1
epplication-selenium |
epplication-selenium | Starting Selenium Grid Standalone...

...

epplication-selenium | 08:43:06.495 INFO [NodeOptions.report] - Adding firefox for {"browserName": "firefox","browserVersion": "117.0","platformName": "linux","se:noVncPort": 7900,"se:vncEnabled": true} 1 times

...

epplication-selenium | 08:43:06.873 INFO [Standalone.execute] - Started Selenium Standalone 4.12.1 (revision 8e34639b11): http://172.19.0.3:4444

when i try to connect

      my $driver = Selenium::Firefox->new(
          remote_server_addr => $conf{host},
          port => $conf{port},
      );

i see this error

epplication-selenium | 09:07:39.949 INFO [LocalDistributor.newSession] - Session request received by the Distributor:
epplication-selenium |  [Capabilities {acceptInsecureCerts: true}]
epplication-selenium | 09:07:40.077 WARN [SeleniumManager.lambda$runCommand$1] - You need to specify a browser or driver
epplication-selenium | 09:07:40.081 WARN [DriverServiceSessionFactory.apply] - Error while creating session with the driver service. Unable to obtain: Capabilities {acceptInsecureCerts: true}, error Command failed with code: 65, executed: [--browser, , --output, json]
epplication-selenium | You need to specify a browser or driver
davewood commented 1 year ago

it works with an older docker-selenium version, buit not with latest.

docker-compose.yml image: selenium/standalone-firefox:114.0-geckodriver-0.33-grid-4.10.0-20230614

and im a bit confused because the README says (https://github.com/teodesian/Selenium-Remote-Driver/blob/master/README.md)

This module is also not ready for SeleniumHQ's 4.0 series JAR. For compatibility with that, try our next generation selenium client: Selenium::Client

teodesian commented 1 year ago

Geckodriver, for a long time had not removed the code to connect via earlier selenium connection strings. That's why it still worked. If that has changed, then things would indeed break the same way they do for the selenium 4 Jar.

teodesian commented 1 year ago

nevertheless this probably means there are no viable workarounds to use this module any longer. I suppose that finally moves this up to the top of my list.