SeleniumHQ / selenium

A browser automation framework and ecosystem.
https://selenium.dev
Apache License 2.0
30.7k stars 8.19k forks source link

[Grid] cannot parse capability: goog:chromeOptions #5152

Closed diemol closed 6 years ago

diemol commented 6 years ago

Meta -

OS: OSX 10.12.6 Selenium Version: 3.8.0 (Java and Python bindings, also Grid) Browser: Chrome

Browser Version:
62.0.3202.94 ChromeDriver=2.33.506106

Expected Behavior -

Start new session when running a test agains a Grid

Actual Behavior -

No session is created and this the error at the client side

org.openqa.selenium.WebDriverException: unknown error: cannot parse capability: goog:chromeOptions
from unknown error: cannot parse binary
from unknown error: must be a string
  (Driver info: chromedriver=2.33.506106 (8a06c39c4582fbfbab6966dbb1c38a9173bfb1a2),platform=Mac OS X 10.12.6 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 5 milliseconds

Steps to reproduce -

  1. Start a hub and a node (previously having ChromeDriver properly configured)
    java -jar selenium-server-standalone-3.8.0.jar -role hub
    java -jar selenium-server-standalone-3.8.0.jar -role node
  2. Execute this test.

These are the hub and node logs:

hub:

23:59:17.419 INFO - Selenium build info: version: '3.8.0', revision: '924c4067df'
23:59:17.420 INFO - Launching Selenium Grid hub
2017-11-30 23:59:18.381:INFO::main: Logging initialized @1414ms to org.seleniumhq.jetty9.util.log.StdErrLog
23:59:18.404 INFO - Will listen on 4444
2017-11-30 23:59:18.490:INFO:osjs.Server:main: jetty-9.4.7.v20170914
2017-11-30 23:59:18.532:INFO:osjs.session:main: DefaultSessionIdManager workerName=node0
2017-11-30 23:59:18.532:INFO:osjs.session:main: No SessionScavenger set, using defaults
2017-11-30 23:59:18.536:INFO:osjs.session:main: Scavenging every 600000ms
2017-11-30 23:59:18.547:INFO:osjsh.ContextHandler:main: Started o.s.j.s.ServletContextHandler@18a70f16{/,null,AVAILABLE}
2017-11-30 23:59:18.581:INFO:osjs.AbstractConnector:main: Started ServerConnector@75f9eccc{HTTP/1.1,[http/1.1]}{0.0.0.0:4444}
2017-11-30 23:59:18.582:INFO:osjs.Server:main: Started @1615ms
23:59:18.582 INFO - Nodes should register to http://192.168.1.7:4444/grid/register/
23:59:18.582 INFO - Selenium Grid hub is up and running
23:59:21.819 INFO - Registered a node http://192.168.1.7:5555
00:04:04.005 INFO - Got a request to create a new session: Capabilities {browserName: chrome, goog:chromeOptions: {args: [], extensions: []}}
00:04:04.025 INFO - Trying to create a new session on test slot {seleniumProtocol=WebDriver, se:CONFIG_UUID=25ba6690-d893-4f22-af45-f31ae43c37f5, browserName=chrome, maxInstances=5, platform=MAC}

node:

23:59:20.806 INFO - Selenium build info: version: '3.8.0', revision: '924c4067df'
23:59:20.807 INFO - Launching a Selenium Grid node
2017-11-30 23:59:21.454:INFO::main: Logging initialized @935ms to org.seleniumhq.jetty9.util.log.StdErrLog
23:59:21.504 INFO - Using `new FirefoxOptions()` is preferred to `DesiredCapabilities.firefox()`
23:59:21.528 INFO - Using `new ChromeOptions()` is preferred to `DesiredCapabilities.chrome()`
23:59:21.533 INFO - Using `new EdgeOptions()` is preferred to `DesiredCapabilities.edge()`
23:59:21.534 INFO - Driver class not found: com.opera.core.systems.OperaDriver
23:59:21.534 INFO - Using `new OperaOptions()` is preferred to `DesiredCapabilities.operaBlink()`
23:59:21.536 INFO - Using `new SafariOptions()` is preferred to `DesiredCapabilities.safari()`
23:59:21.537 INFO - Driver class not found: org.openqa.selenium.phantomjs.PhantomJSDriver
23:59:21.566 INFO - Driver provider class org.openqa.selenium.ie.InternetExplorerDriver registration is skipped:
 registration capabilities Capabilities {browserName: internet explorer, ensureCleanSession: true, platform: WINDOWS, version: } does not match the current platform MAC
23:59:21.566 INFO - Driver provider class org.openqa.selenium.edge.EdgeDriver registration is skipped:
 registration capabilities Capabilities {browserName: MicrosoftEdge, platform: WINDOWS, version: } does not match the current platform MAC
23:59:21.605 INFO - Using `new ChromeOptions()` is preferred to `DesiredCapabilities.chrome()`
23:59:21.607 INFO - Using `new EdgeOptions()` is preferred to `DesiredCapabilities.edge()`
23:59:21.607 INFO - Using `new FirefoxOptions()` is preferred to `DesiredCapabilities.firefox()`
23:59:21.608 INFO - Using `new OperaOptions()` is preferred to `DesiredCapabilities.operaBlink()`
23:59:21.608 INFO - Using `new SafariOptions()` is preferred to `DesiredCapabilities.safari()`
23:59:21.619 INFO - Using the passthrough mode handler
2017-11-30 23:59:21.651:INFO:osjs.Server:main: jetty-9.4.7.v20170914
2017-11-30 23:59:21.679:WARN:osjs.SecurityHandler:main: ServletContext@o.s.j.s.ServletContextHandler@6200f9cb{/,null,STARTING} has uncovered http methods for path: /
2017-11-30 23:59:21.683:INFO:osjsh.ContextHandler:main: Started o.s.j.s.ServletContextHandler@6200f9cb{/,null,AVAILABLE}
2017-11-30 23:59:21.707:INFO:osjs.AbstractConnector:main: Started ServerConnector@6aaceffd{HTTP/1.1,[http/1.1]}{0.0.0.0:5555}
2017-11-30 23:59:21.709:INFO:osjs.Server:main: Started @1189ms
23:59:21.709 INFO - Selenium Grid node is up and ready to register to the hub
23:59:21.740 INFO - Starting auto registration thread. Will try to register every 5000 ms.
23:59:21.740 INFO - Registering the node to the hub: http://localhost:4444/grid/register
23:59:21.819 INFO - The node is registered to the hub and ready to use
2017-12-01 00:04:04.066:INFO:osjshC.ROOT:qtp172032696-15: org.openqa.selenium.remote.server.WebDriverServlet-3590fc5b: Initialising WebDriverServlet
00:04:04.115 INFO - Found handler: org.openqa.selenium.remote.server.commandhandler.BeginSession@2f551120
00:04:04.129 INFO - /session: Executing POST on /session (handler: BeginSession)
00:04:04.276 INFO - Capabilities are: Capabilities {browserName: chrome, goog:chromeOptions: {args: [], binary: null, extensions: []}, se:CONFIG_UUID: 25ba6690-d893-4f22-af45-f31...}
00:04:04.281 INFO - Capabilities {browserName: chrome, goog:chromeOptions: {args: [], binary: null, extensions: []}, se:CONFIG_UUID: 25ba6690-d893-4f22-af45-f31...} matched class org.openqa.selenium.remote.server.ServicedSession$Factory (provider: org.openqa.selenium.chrome.ChromeDriverService)
Starting ChromeDriver 2.33.506106 (8a06c39c4582fbfbab6966dbb1c38a9173bfb1a2) on port 26803
Only local connections are allowed.

I think the issue could be here:

00:04:04.276 INFO - Capabilities are: Capabilities {browserName: chrome, goog:chromeOptions: {args: [], binary: null, extensions: []}, se:CONFIG_UUID: 25ba6690-d893-4f22-af45-f31...}
00:04:04.281 INFO - Capabilities {browserName: chrome, goog:chromeOptions: {args: [], binary: null, extensions: []}, se:CONFIG_UUID: 25ba6690-d893-4f22-af45-f31...} matched class org.openqa.selenium.remote.server.ServicedSession$Factory (provider: org.openqa.selenium.chrome.ChromeDriverService)

Seems that the Chrome options are receiving a null as value for the binary key.

EDIT: I tried again with the grid in Standalone mode, and it works. Seems that it only fails when using hub/node.

barancev commented 6 years ago

Fixed by 7055d6f64c29368092bcb07d606d9605b7ec6247 Version 3.8.1 released with this fix.

diemol commented 6 years ago

Just tested it and it works well. Thanks @barancev

pradudev commented 6 years ago

Thanks @barancev

sbabcoc commented 6 years ago

@barancev - I can't find the 3.8.1 release of selenium-server-standalone. Did this not get deployed?

lmtierney commented 6 years ago

@sbabcoc http://selenium-release.storage.googleapis.com/index.html?path=3.8/

sbabcoc commented 6 years ago

Thanks, @lmtierney ! I'd forgotten that release hierarchy was available. I was expecting that Maven would be able to download the artifact automatically, but it hasn't been released to the public Maven repos.

barancev commented 6 years ago

Version 3.8.1 is available in maven central: http://search.maven.org/#artifactdetails%7Corg.seleniumhq.selenium%7Cselenium-java%7C3.8.1%7Cjar

barancev commented 6 years ago

But, yes, selenium server standalone is not a maven artifact.