microsoft / edge-selenium-tools

An updated EdgeDriver implementation for Selenium 3 with newly-added support for Microsoft Edge (Chromium).
https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/
Apache License 2.0
88 stars 24 forks source link

Unable to create service: EdgeDriverService #37

Closed scook12 closed 3 years ago

scook12 commented 3 years ago

Trying to run msedge in a docker container as part of a selenium grid deployment, can't get the driver service to start and the error message just says that it can't start the service.

Code:

conn = EdgeRemoteConnection(remote_webdriver_url)
remote = webdriver.Remote(command_executor=conn, options=options)

Result of options.to_capabilities() :

{
  'browserName': 'MicrosoftEdge', 
  'version': '', 
  'platform': 'Linux',
  'ms:edgeOptions': {
    'extensions': [], 
    'binary': 'msedgedriver', 
    'args': ['--disable-infobars', '--disable-notifications', '--enable-automatic-password-saving', '--log-level=1', '--ignore-ssl- 
      errors=yes', '--ignore-certificate-errors']
}, 'ms:edgeChromium': True
}

Narrowing further, just calling .execute throws the same thing: conn.execute('newSession', params={"desiredCapabilities": caps})

Versions: selenium=3.141 driver=90.0.796.0

Any ideas?

bwalderman commented 3 years ago

Hi @scook12. You might be interested in upgrading to Selenium 4 Beta. The new Selenium Grid is updated for Edge Chromium and the Selenium crew maintains docker images for Edge Chromium and other browsers here: https://github.com/SeleniumHQ/docker-selenium

Having said that, if you'd like to keep using Selenium 3, this mostly looks good except the binary capability is for choosing a browser binary to launch, not a driver binary. Selenium Grid 3 is configured to run Edge Legacy by default so it is attempting to launch the legacy WebDriver windows binary (MicrosoftWebDriver.exe).

To configure Grid to run msedgedriver, set the webdriver.edge.driver property to msedgedriver when starting the Grid node. For example:

java -Dwebdriver.edge.driver=msedgedriver.exe -jar .\selenium-server-standalone-3.141.59.jar -role node

Then update the binary capability in your options to point to the installed Edge Chromium binary. Or, you can omit the binary capability and msedgedriver will try to locate it automatically.

scook12 commented 3 years ago

Thanks for your help! The change you suggested did get me a bit further, though the service still isn't getting created. I'm looking forward to selenium 4 and grid 4, but we can't update to that yet. Closing this as you've answered my questions!