selenium icon indicating copy to clipboard operation
selenium copied to clipboard

Add `NewSeleniumServiceV4` to support cli args for selenium version 4

Open Prendo93 opened this issue 3 years ago • 4 comments

Selenium V3 seems to now be considered legacy (https://www.selenium.dev/documentation/legacy/selenium_3/). This PR adds NewSeleniumServiceV4 which sets up the service using the new format for v4. During my (admittedly limited) testing it seems to work as a drop-in replacement for Selenium V3 implementation.

Prendo93 avatar Jan 12 '22 02:01 Prendo93

Would it be possible to merge this? @minusnine

ChristianSch avatar Mar 17 '22 10:03 ChristianSch

I'm also not sure that this is correct. The PR uses /wd/hub as the urlPrefix (which is a suffix btw), which doesn't seem to be used by selenium 4:

GET http://localhost:4444/wd/hub
-> 
{
  "value": {
    "error": "unknown command",
    "message": "Unable to find handler for (GET) \u002fwd\u002fhub",
    "stacktrace": ""
  }
}

(same for POST)

@Prendo93 did this actually work for you?

ChristianSch avatar Mar 22 '22 10:03 ChristianSch

Can confirm this is working for me with https://github.com/SeleniumHQ/selenium/releases/download/selenium-4.1.0/selenium-server-4.1.1.jar

I think the urlPrefix is named thus because there are other routes called, eg: /wd/hub/session etc.

Prendo93 avatar Mar 23 '22 01:03 Prendo93

Hm, ok. Do you specify a prefix? Or do you omit it? Would you mind posting a quick example where it's running for you? Would help tremendously!

Edit: it actually does work! It just doesn't work with the selenium standalone docker images for some reason.

ChristianSch avatar Mar 23 '22 07:03 ChristianSch