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

Node config "chrome_binary" causes an exception when ChromeOptions capability is set #342

Closed
geyzer opened this issue Mar 17, 2015 · 1 comment

Comments

@geyzer
Copy link

geyzer commented Mar 17, 2015

Driver initialization code:

DesiredCapabilities dc = new DesiredCapabilities();
dc.setBrowserName('chrome');
ChromeOptions options = new ChromeOptions();
options.addArguments("start-maximized");
dc.setCapability(ChromeOptions.CAPABILITY, options)
RemoteWebDriver driver = new RemoteWebDriver(new URL('http://localhost:4444/wd/hub'), dc);

nodeconfig.json code:

"browserName": "chrome",
"chrome_binary": "C:\\Tools\\GoogleChromePortable\\App\\Chrome-bin\\chrome.exe"
Exception:
 org.openqa.grid.common.exception.GridException: Error forwarding the new session The listener threw an exception ( listener bug )
    at org.openqa.grid.web.servlet.handler.RequestHandler.process(RequestHandler.java:114)
    at org.openqa.grid.web.servlet.DriverServlet.process(DriverServlet.java:83)
    at org.openqa.grid.web.servlet.DriverServlet.doPost(DriverServlet.java:67)
    at org.seleniumhq.jetty7.servlet.ServletHolder.handle(ServletHolder.java:565)
    at org.seleniumhq.jetty7.servlet.ServletHandler.doHandle(ServletHandler.java:479)
    at org.seleniumhq.jetty7.server.session.SessionHandler.doHandle(SessionHandler.java:225)
    at org.seleniumhq.jetty7.server.handler.ContextHandler.doHandle(ContextHandler.java:1031)
    at org.seleniumhq.jetty7.servlet.ServletHandler.doScope(ServletHandler.java:406)
    at org.seleniumhq.jetty7.server.session.SessionHandler.doScope(SessionHandler.java:186)
    at org.seleniumhq.jetty7.server.handler.ContextHandler.doScope(ContextHandler.java:965)
    at org.seleniumhq.jetty7.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
    at org.seleniumhq.jetty7.server.handler.HandlerWrapper.handle(HandlerWrapper.java:111)
    at org.seleniumhq.jetty7.server.Server.handle(Server.java:349)
    at org.seleniumhq.jetty7.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:452)
    at org.seleniumhq.jetty7.server.BlockingHttpConnection.handleRequest(BlockingHttpConnection.java:47)
    at org.seleniumhq.jetty7.server.AbstractHttpConnection.content(AbstractHttpConnection.java:894)
    at org.seleniumhq.jetty7.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:948)
    at org.seleniumhq.jetty7.http.HttpParser.parseNext(HttpParser.java:857)
    at org.seleniumhq.jetty7.http.HttpParser.parseAvailable(HttpParser.java:235)
    at org.seleniumhq.jetty7.server.BlockingHttpConnection.handle(BlockingHttpConnection.java:66)
    at org.seleniumhq.jetty7.server.bio.SocketConnector$ConnectorEndPoint.run(SocketConnector.java:254)
    at org.seleniumhq.jetty7.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:599)
    at org.seleniumhq.jetty7.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:534)

I believe it has something to do with DefaultRemoteProxy.java code:

      if (BrowserType.CHROME.equals(cap.get(CapabilityType.BROWSER_NAME))) {
        if (session.getSlot().getCapabilities().get("chrome_binary") != null) {
          JsonObject options = (JsonObject) cap.get(ChromeOptions.CAPABILITY);
          if (options == null) {
            options = new JsonObject();
          }
          options.addProperty("binary", (String) session.getSlot().getCapabilities().get("chrome_binary"));
          cap.put(ChromeOptions.CAPABILITY, options);
        }

Removed "chrome_binary" from nodeconfig.json - no exception, "start-maximized" passed fine.
Removed dc.setCapability(ChromeOptions.CAPABILITY, options) line - no exception, "chrome_binary" works fine.

@geekecom
Copy link

geekecom commented May 24, 2017

In my case the problem was related to the capabilities config. I used 'version=lastest', now I'm not configuring the 'version' property (leaving it as default) and it works. Hope this helps to someone

@lock lock bot locked and limited conversation to collaborators Aug 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants