Org openqa selenium webdriverexception unknown error cannot find chrome binary

Meta - OS: Windows 7 Selenium Version: 3.5.2 Geckodriver Version: 0.18.0 Browser: Firefox 54 Really weird issue here where I attempt to launch a Firefox instance through Grid and get the following ...

Meta —

OS:
Windows 7

Selenium Version:
3.5.2

Geckodriver Version:
0.18.0

Browser:
Firefox 54

Really weird issue here where I attempt to launch a Firefox instance through Grid and get the following error in the Grid log:

org.openqa.selenium.WebDriverException: unknown error: cannot find Chrome binary

Expected Behavior —

Firefox instance is launched on node

Actual Behavior —

The following exception returned on hub:
org.openqa.selenium.WebDriverException: unknown error: cannot find Chrome binary

Despite the fact I do not have Chrome mentioned anywhere in my configuration and it is not installed on the node.

Steps to reproduce —

Hub config:

{
  "port": 4445,
  "newSessionWaitTimeout": -1,
  "servlets" : [],
  "withoutServlets": [],
  "custom": {},
  "capabilityMatcher": "org.openqa.grid.internal.utils.DefaultCapabilityMatcher",
  "throwOnCapabilityNotPresent": true,
  "cleanUpCycle": 5000,
  "role": "hub",
  "debug": false,
  "browserTimeout": 0,
  "timeout": 1800
}

Hub start batch:
java -cp "lib*;selenium-server-standalone-3.5.2.jar" org.openqa.grid.selenium.GridLauncherV3 -role hub -hubConfig "C:seleniumhubConfig-3.5.2.json" >"C:seleniumlogs-3.5.2hub.log" 2>"C:seleniumlogs-3.5.2hub.error.log"

Node config:

{
  "capabilities":
  [
    {
      "browserName": "firefox",
      "maxInstances": 5,
      "seleniumProtocol": "WebDriver",
      "version": "54",
      "firefox_binary":"C:\Program Files\Mozilla Firefox\firefox.exe"
    }
  ],
  "proxy": "org.openqa.grid.selenium.proxy.DefaultRemoteProxy",
  "maxSession": 5,
  "port": 5555,
  "register": true,
  "registerCycle": 5000,
  "hub": "http://hubhost4445",
  "nodeStatusCheckTimeout": 5000,
  "nodePolling": 5000,
  "role": "node",
  "unregisterIfStillDownAfter": 60000,
  "downPollingLimit": 2,
  "debug": false,
  "servlets" : [],
  "withoutServlets": [],
  "custom": {}
}

Node starter batch:
java -Dwebdriver.gecko.driver="C:seleniumgeckodriver.exe" -jar selenium-server-standalone-3.5.2.jar -role node -nodeConfig "C:seleniumnodeConfig_3.5.2.json" -debug

Code:

@Test
	public void findMarionetteOnGithub() throws MalformedURLException {

		System.setProperty("webdriver.gecko.driver", "C:\temp\geckodriver.exe");
		DesiredCapabilities capabilities = new DesiredCapabilities();
		capabilities.setCapability("marionette", true);
		WebDriver driver = new RemoteWebDriver(new URL("http://hubhost:4445/wd/hub"), capabilities);
		WebDriverWait wait = new WebDriverWait(driver, 10);
		driver.close();

	}

Debug output on hub:

11:09:35.234 DEBUG - Memory-based payload for: {desiredCapabilities={marionette=true}, capabilities={firstMatch=[], desiredCapabilities={marionette=true}, alwaysMatch={}, requiredCapabilities={}}, requiredCapabilities={}}
11:09:35.235 INFO - Mismatched capabilities. Creating a synthetic w3c capability.
11:09:35.235 INFO - Got a request to create a new session: Capabilities [{marionette=true}]
11:09:35.236 DEBUG - Available nodes: [http://nodehost:5555]
11:09:35.236 DEBUG - Trying to create a new session on node http://nodehost:5555
11:09:35.236 INFO - Trying to create a new session on test slot {seleniumProtocol=WebDriver, firefox_binary=C:Program FilesMozilla Firefoxfirefox.exe, browserName=firefox, maxInstances=5, version=54, platform=VISTA}
11:09:35.236 DEBUG - Closing connections idle longer than 100 MILLISECONDS
11:09:35.236 DEBUG - http-outgoing-536: Close connection
11:09:35.237 DEBUG - CookieSpec selected: default
11:09:35.238 DEBUG - Auth cache not set in the context
11:09:35.238 DEBUG - Connection request: [route: {}->http://nodehost:5555][total kept alive: 0; route allocated: 0 of 2000; total allocated: 0 of 2000]
11:09:35.238 DEBUG - Connection leased: [id: 537][route: {}->http://nodehost:5555][total kept alive: 0; route allocated: 1 of 2000; total allocated: 1 of 2000]
11:09:35.238 DEBUG - Opening connection {}->http://nodehost:5555
11:09:35.238 DEBUG - Connecting to /nodehost:5555
11:09:35.239 DEBUG - Connection established hubhost:57503<->nodehost:5555
11:09:35.239 DEBUG - http-outgoing-537: set socket timeout to 0
11:09:35.240 DEBUG - Executing request POST /wd/hub/session HTTP/1.1
11:09:35.240 DEBUG - Target auth state: UNCHALLENGED
11:09:35.240 DEBUG - Proxy auth state: UNCHALLENGED
11:09:35.240 DEBUG - http-outgoing-537 >> POST /wd/hub/session HTTP/1.1
11:09:35.240 DEBUG - http-outgoing-537 >> Connection: keep-alive
11:09:35.240 DEBUG - http-outgoing-537 >> User-Agent: Apache-HttpClient/4.5.1 (Java/1.8.0_45)
11:09:35.240 DEBUG - http-outgoing-537 >> Host: hubhost:4445
11:09:35.241 DEBUG - http-outgoing-537 >> Accept-Encoding: gzip,deflate
11:09:35.241 DEBUG - http-outgoing-537 >> Content-Type: application/json; charset=UTF-8
11:09:35.241 DEBUG - http-outgoing-537 >> Content-Length: 249
11:09:35.241 DEBUG - http-outgoing-537 >> "POST /wd/hub/session HTTP/1.1[r][n]"
11:09:35.241 DEBUG - http-outgoing-537 >> "Connection: keep-alive[r][n]"
11:09:35.241 DEBUG - http-outgoing-537 >> "User-Agent: Apache-HttpClient/4.5.1 (Java/1.8.0_45)[r][n]"
11:09:35.241 DEBUG - http-outgoing-537 >> "Host: hubhost:4445[r][n]"
11:09:35.242 DEBUG - http-outgoing-537 >> "Accept-Encoding: gzip,deflate[r][n]"
11:09:35.242 DEBUG - http-outgoing-537 >> "Content-Type: application/json; charset=UTF-8[r][n]"
11:09:35.242 DEBUG - http-outgoing-537 >> "Content-Length: 249[r][n]"
11:09:35.242 DEBUG - http-outgoing-537 >> "[r][n]"
11:09:35.242 DEBUG - http-outgoing-537 >> "{[n]"
11:09:35.242 DEBUG - http-outgoing-537 >> "  "desiredCapabilities": {[n]"
11:09:35.242 DEBUG - http-outgoing-537 >> "    "marionette": true[n]"
11:09:35.243 DEBUG - http-outgoing-537 >> "  },[n]"
11:09:35.243 DEBUG - http-outgoing-537 >> "  "requiredCapabilities": {},[n]"
11:09:35.243 DEBUG - http-outgoing-537 >> "  "capabilities": {[n]"
11:09:35.243 DEBUG - http-outgoing-537 >> "    "desiredCapabilities": {[n]"
11:09:35.243 DEBUG - http-outgoing-537 >> "      "marionette": true[n]"
11:09:35.243 DEBUG - http-outgoing-537 >> "    },[n]"
11:09:35.243 DEBUG - http-outgoing-537 >> "    "requiredCapabilities": {},[n]"
11:09:35.243 DEBUG - http-outgoing-537 >> "    "alwaysMatch": {},[n]"
11:09:35.244 DEBUG - http-outgoing-537 >> "    "firstMatch": [][n]"
11:09:35.244 DEBUG - http-outgoing-537 >> "  }[n]"
11:09:35.244 DEBUG - http-outgoing-537 >> "}"
11:09:36.111 DEBUG - http-outgoing-537 << "HTTP/1.1 500 Server Error[r][n]"
11:09:36.111 DEBUG - http-outgoing-537 << "Content-Type: application/json;charset=utf-8[r][n]"
11:09:36.111 DEBUG - http-outgoing-537 << "Content-Length: 8612[r][n]"
11:09:36.111 DEBUG - http-outgoing-537 << "Server: Jetty(9.4.5.v20170502)[r][n]"
11:09:36.111 DEBUG - http-outgoing-537 << "[r][n]"
11:09:36.112 DEBUG - http-outgoing-537 << "{"value":{"stacktrace":"org.openqa.selenium.WebDriverException: unknown error: cannot find Chrome binaryn  (Driver info: chromedriver=2.11.298604 (75ea2fdb5c87f133a8e1b8da16f6091fb7d5321e),platform=Windows NT 6.1 SP1 x86_64) (WARNING: The server did not provide any stacktrace information)nCommand duration or timeout: 57 millisecondsnBuild info: version: '3.5.2', revision: '10229a9020', time: '2017-08-21T17:54:21.164Z'nSystem info: host: 'MS406186F622A9', ip: 'nodehost', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_25'nDriver info: driver.version: unknownrntat sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)rntat sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)rntat sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)rntat java.lang.reflect.Constructor.newInstance(Unknown Source)rntat org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:215)rntat org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:167)rntat org.openqa.selenium.remote.JsonWireProtocolResponse.lambda$new$0(JsonWireProtocolResponse.java:53)rntat org.openqa.selenium.remote.JsonWireProtocolResponse$$Lambda$121/297298413.apply(Unknown Source)rntat org.openqa.selenium.remote.JsonWireProtocolResponse.lambda$getResponseFunction$2(JsonWireProtocolResponse.java:91)rntat org.openqa.selenium.remote.JsonWireProtocolResponse$$Lambda$123/1797835797.apply(Unknown Source)rntat org.openqa.selenium.remote.ProtocolHandshake.lambda$createSession$24(ProtocolHandshake.java:359)rntat org.openqa.selenium.remote.ProtocolHandshake$$Lambda$130/440049290.apply(Unknown Source)rntat java.util.stream.ReferencePipeline$3$1.accept(Unknown Source)rntat java.util.Spliterators$ArraySpliterator.tryAdvance(Unknown Source)rntat java.util.stream.ReferencePipeline.forEachWithCancel(Unknown Source)rntat java.util.stream.AbstractPipeline.copyIntoWithCancel(Unknown Source)rntat java.util.stream.AbstractPipeline.copyInto(Unknown Source)rntat java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)rntat java.util.stream.FindOps$FindOp.evaluateSequential(Unknown Source)rntat java.util.stream.AbstractPipeline.evaluate(Unknown Source)rntat java.util.stream.ReferencePipeline.findFirst(Unknown Source)rntat org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:362)rntat org.openqa.selenium.remote.server.ServicedSession$Factory.apply(ServicedSession.java:172)rntat org.openqa.selenium.remote.server.ActiveSessionFactory.lambda$createSession$15(ActiveSessionFactory.java:148)rntat org.openqa.selenium.remote.server.ActiveSessionFactory$$Lambda$114/975961810.apply(Unknown Source)rntat java.util.Optional.map(Unknown Source)rntat org.openqa.selenium.remote.server.ActiveSessionFactory.createSession(ActiveSessionFactory.java:148)rntat org.openqa.selenium.remote.server.BeginSession.execute(BeginSession.java:67)rntat org.openqa.selenium.remote.server.WebDriverServlet.lambda$handle$0(WebDriverServlet.java:231)rntat org.openqa.selenium.remote.server.WebDriverServlet$$Lambda$46/1504987566.run(Unknown Source)rntat java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)rntat java.util.concurrent.FutureTask.run(Unknown Source)rntat java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)rntat java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)rntat java.lang.Thread.run(Unknown Source)rn","stackTrace":[{"fileName":null,"methodName":"newInstance0","className":"sun.reflect.NativeConstructorAccessorImpl","lineNumber":-2},{"fileName":null,"methodName":"newInstance","className":"sun.reflect.NativeConstructorAccessorImpl","lineNumber":-1},{"fileName":null,"methodName":"newInstance","className":"sun.reflect.DelegatingConstructorAccessorImpl","lineNumber":-1},{"fileName":null,"methodName":"newInstance","className":"java.lang.reflect.Constructor","lineNumber":-1},{"fileName":"ErrorHandler.java","methodName":"createThrowable","className":"org.openqa.selenium.remote.ErrorHandler","lineNumber":215},{"fileName":"ErrorHandler.java","methodName":"throwIfResponseFailed","className":"org.openqa.selenium.remote.ErrorHandler","lineNumber":167},{"fileName":"JsonWireProtocolResponse.java","methodName":"lambda$new$0","className":"org.openqa.selenium.remote.JsonWireProtocolResponse","lineNumber":53},{"fileName":null,"methodName":"apply","className":"org.openqa.selenium.remote.JsonWireProtocolResponse$$Lambda$121/297298413","lineNumber":-1},{"fileName":"JsonWireProtocolResponse.java","methodName":"lambda$getResponseFunction$2","className":"org.openqa.selenium.remote.JsonWireProtocolResponse","lineNumber":91},{"fileName":null,"methodName":"apply","className":"org.openqa.selenium.remote.JsonWireProtocolResponse$$Lambda$123/1797835797","lineNumber":-1},{"fileName":"ProtocolHandshake.java","methodName":"lambda$createSession$24","className":"org.openqa.selenium.remote.ProtocolHandshake","lineNumber":359},{"fileName":null,"methodName":"apply","className":"org.openqa.selenium.remote.ProtocolHandshake$$Lambda$130/440049290","lineNumber":-1},{"fileName":null,"methodName":"accept","className":"java.util.stream.ReferencePipeline$3$1","lineNumber":-1},{"fileName":null,"methodName":"tryAdvance","className":"java.util.Spliterators$ArraySpliterator","lineNumber":-1},{"fileName":null,"methodName":"forEachWithCancel","className":"java.util.stream.ReferencePipeline","lineNumber":-1},{"fileName":null,"methodName":"copyIntoWithCancel","className":"java.util.stream.AbstractPipeline","lineNumber":-1},{"fileName":null,"methodName":"copyInto","className":"java.util.stream.AbstractPipeline","lineNumber":-1},{"fileName":null,"methodName":"wrapAndCopyInto","className":"java.util.stream.AbstractPipeline","lineNumber":-1},{"fileName":null,"methodName":"evaluateSequential","className":"java.util.stream.FindOps$FindOp","lineNumber":-1},{"fileName":null,"methodName":"evaluate","className":"java.util.stream.AbstractPipeline","lineNumber":-1},{"fileName":null,"methodName":"findFirst","className":"java.util.stream.ReferencePipeline","lineNumber":-1},{"fileName":"ProtocolHandshake.java","methodName":"createSession","className":"org.openqa.selenium.remote.ProtocolHandshake","lineNumber":362},{"fileName":"ServicedSession.java","methodName":"apply","className":"org.openqa.selenium.remote.server.ServicedSession$Factory","lineNumber":172},{"fileName":"ActiveSessionFactory.java","methodName":"lambda$createSession$15","className":"org.openqa.selenium.remote.server.ActiveSessionFactory","lineNumber":148},{"fileName":null,"methodName":"apply","className":"org.openqa.selenium.remote.server.ActiveSessionFactory$$Lambda$114/975961810","lineNumber":-1},{"fileName":null,"methodName":"map","className":"java.util.Optional","lineNumber":-1},{"fileName":"ActiveSessionFactory.java","methodName":"createSession","className":"org.openqa.selenium.remote.server.ActiveSessionFactory","lineNumber":148},{"fileName":"BeginSession.java","methodName":"execute","className":"org.openqa.selenium.remote.server.BeginSession","lineNumber":67},{"fileName":"WebDriverServlet.java","methodName":"lambda$handle$0","className":"org.openqa.selenium.remote.server.WebDriverServlet","lineNumber":231},{"fileName":null,"methodName":"run","className":"org.openqa.selenium.remote.server.WebDriverServlet$$Lambda$46/1504987566","lineNumber":-1},{"fileName":null,"methodName":"call","className":"java.util.concurrent.Executors$RunnableAdapter","lineNumber":-1},{"fileName":null,"methodName":"run","className":"java.util.concurrent.FutureTask","lineNumber":-1},{"fileName":null,"methodName":"runWorker","className":"java.util.concurrent.ThreadPoolExecutor","lineNumber":-1},{"fileName":null,"methodName":"run","className":"java.util.concurrent.ThreadPoolExecutor$Worker","lineNumber":-1},{"fileName":null,"methodName":"run","className":"java.lang.Thread","lineNumber":-1}],"message":"unknown error: cannot find Ch"
11:09:36.112 DEBUG - http-outgoing-537 << HTTP/1.1 500 Server Error
11:09:36.112 DEBUG - http-outgoing-537 << Content-Type: application/json;charset=utf-8
11:09:36.112 DEBUG - http-outgoing-537 << Content-Length: 8612
11:09:36.112 DEBUG - http-outgoing-537 << Server: Jetty(9.4.5.v20170502)
11:09:36.113 DEBUG - Connection can be kept alive indefinitely
11:09:36.113 DEBUG - http-outgoing-537 << "rome binaryn  (Driver info: chromedriver=2.11.298604 (75ea2fdb5c87f133a8e1b8da16f6091fb7d5321e),platform=Windows NT 6.1 SP1 x86_64) (WARNING: The server did not provide any stacktrace information)nCommand duration or timeout: 57 millisecondsnBuild info: version: '3.5.2', revision: '10229a9020', time: '2017-08-21T17:54:21.164Z'nSystem info: host: 'MS406186F622A9', ip: 'nodehost', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_25'nDriver info: driver.version: unknown","error":"unknown error"},"status":13}"
11:09:36.114 DEBUG - Connection [id: 537][route: {}->http://nodehost:5555] can be kept alive indefinitely
11:09:36.114 DEBUG - Connection released: [id: 537][route: {}->http://nodehost:5555][total kept alive: 1; route allocated: 1 of 2000; total allocated: 1 of 2000]
11:09:36.298 DEBUG - Closing connections idle longer than 100 MILLISECONDS
11:09:36.298 DEBUG - http-outgoing-537: Close connection
11:09:36.299 DEBUG - CookieSpec selected: default
11:09:36.299 DEBUG - Auth cache not set in the context
11:09:36.299 DEBUG - Connection request: [route: {}->http://nodehost:5555][total kept alive: 0; route allocated: 0 of 2000; total allocated: 0 of 2000]
11:09:36.299 DEBUG - Connection leased: [id: 538][route: {}->http://nodehost:5555][total kept alive: 0; route allocated: 1 of 2000; total allocated: 1 of 2000]
11:09:36.299 DEBUG - Opening connection {}->http://nodehost:5555
11:09:36.299 DEBUG - Connecting to /nodehost:5555
11:09:36.300 DEBUG - Connection established gubhost:57507<->nodehost:5555
11:09:36.300 DEBUG - http-outgoing-538: set socket timeout to 5000
11:09:36.300 DEBUG - Executing request GET /wd/hub/status HTTP/1.1
11:09:36.300 DEBUG - Target auth state: UNCHALLENGED
11:09:36.300 DEBUG - Proxy auth state: UNCHALLENGED
11:09:36.300 DEBUG - http-outgoing-538 >> GET /wd/hub/status HTTP/1.1

If add the following line to the code:

capabilities.setBrowserName("firefox");

Then I get the below exception

The same is happening if I define the capabilities object statically like so:

DesiredCapabilities capabilities = DesiredCapabilities.firefox();

org.openqa.selenium.WebDriverException: Error forwarding the new session The listener threw an exception ( listener bug )
Command duration or timeout: 55 milliseconds
Build info: version: '3.5.2', revision: '10229a9', time: '2017-08-21T17:29:55.15Z'
System info: host: 'MSF0795991157F', ip: '10.25.67.134', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_45'
Driver info: driver.version: RemoteWebDriver
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
	at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:215)
	at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:167)
	at org.openqa.selenium.remote.JsonWireProtocolResponse.lambda$new$0(JsonWireProtocolResponse.java:53)
	at org.openqa.selenium.remote.JsonWireProtocolResponse$$Lambda$70/1280851663.apply(Unknown Source)
	at org.openqa.selenium.remote.JsonWireProtocolResponse.lambda$getResponseFunction$2(JsonWireProtocolResponse.java:91)
	at org.openqa.selenium.remote.JsonWireProtocolResponse$$Lambda$72/1223867739.apply(Unknown Source)
	at org.openqa.selenium.remote.ProtocolHandshake.lambda$createSession$24(ProtocolHandshake.java:359)
	at org.openqa.selenium.remote.ProtocolHandshake$$Lambda$79/2005435445.apply(Unknown Source)
	at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
	at java.util.Spliterators$ArraySpliterator.tryAdvance(Spliterators.java:958)
	at java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:126)
	at java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:529)
	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:516)
	at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:502)
	at java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:152)
	at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:464)
	at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:362)
	at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:136)
	at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:142)
	at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:641)
	at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:254)
	at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:236)
	at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:137)
	at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:174)
	at au.com.permeance.test.functional.configuration.WebDriverTest.findMarionetteOnGithub(WebDriverTest.java:28)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:497)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
Caused by: 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:110)
	at org.openqa.grid.web.servlet.DriverServlet.process(DriverServlet.java:84)
	at org.openqa.grid.web.servlet.DriverServlet.doPost(DriverServlet.java:68)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
	at org.seleniumhq.jetty9.servlet.ServletHolder.handle(ServletHolder.java:841)
	at org.seleniumhq.jetty9.servlet.ServletHandler.doHandle(ServletHandler.java:535)
	at org.seleniumhq.jetty9.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:188)
	at org.seleniumhq.jetty9.server.session.SessionHandler.doHandle(SessionHandler.java:1595)
	at org.seleniumhq.jetty9.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:188)
	at org.seleniumhq.jetty9.server.handler.ContextHandler.doHandle(ContextHandler.java:1253)
	at org.seleniumhq.jetty9.server.handler.ScopedHandler.nextScope(ScopedHandler.java:168)
	at org.seleniumhq.jetty9.servlet.ServletHandler.doScope(ServletHandler.java:473)
	at org.seleniumhq.jetty9.server.session.SessionHandler.doScope(SessionHandler.java:1564)
	at org.seleniumhq.jetty9.server.handler.ScopedHandler.nextScope(ScopedHandler.java:166)
	at org.seleniumhq.jetty9.server.handler.ContextHandler.doScope(ContextHandler.java:1155)
	at org.seleniumhq.jetty9.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
	at org.seleniumhq.jetty9.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
	at org.seleniumhq.jetty9.server.Server.handle(Server.java:564)
	at org.seleniumhq.jetty9.server.HttpChannel.handle(HttpChannel.java:317)
	at org.seleniumhq.jetty9.server.HttpConnection.onFillable(HttpConnection.java:251)
	at org.seleniumhq.jetty9.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:279)
	at org.seleniumhq.jetty9.io.FillInterest.fillable(FillInterest.java:110)
	at org.seleniumhq.jetty9.io.ChannelEndPoint$2.run(ChannelEndPoint.java:124)
	at org.seleniumhq.jetty9.util.thread.Invocable.invokePreferred(Invocable.java:128)
	at org.seleniumhq.jetty9.util.thread.Invocable$InvocableExecutor.invoke(Invocable.java:222)
	at org.seleniumhq.jetty9.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:294)
	at org.seleniumhq.jetty9.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:199)
	at org.seleniumhq.jetty9.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:672)
	at org.seleniumhq.jetty9.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:590)
	at java.lang.Thread.run(Thread.java:745)

You fire up your Selenium-based Chrome browser automation operation(s) one fine day and you are greeted with a godawful bit of an exception, at the bottom of which you read the following:

selenium.common.exceptions.WebDriverException: Message: unknown error: cannot find Chrome binary

Puzzled, “It was working optimally just yesterday!”, you think to yourself, wondering what the variable causing this could be. The infamously trusty Stack Overflow does not tell you much about this, except that you probably need to explicitly set the Google Chrome binary’s path as so:

...
chromeOptions = webdriver.ChromeOptions()
chromeOptions.binary_location = "C:Program
FilesGoogleChromeApplication" chromeDriver = "/chromedriver.exe"
driver = webdriver.Chrome(chromeDriver, options=chromeOptions)
...

But, “dude”—you ask yourself—”why should I explicitly set the Google Chrome binary’s path?” or maybe “Why was this not required just yesterday?”

Well, for the curious minds that made it here, may you have the strength of a thousand Suns, for we are a different people that consist of special gears in our heads that start “churning” once an inconsistency makes its way into our lives; and instead of just “fixing” the capsizing ship with a chunky roll of Flex tape (not sponsored) over the cracks and holes, we would like to know how it happened, what made it happen, and why it happened—as we abandon ship and auto-inflate our enormous life raft (using Selenium, of course, ’cause “automation”) and then sail off into the sunset as we code an Apache helicopter into existence (what ship? Pfft).

Now if there’s one thing you can be sure of, it’s that nothing is more powerful than a young boy’s wish. Except an Apache helicopter. An Apache helicopter has machine guns AND missiles. It is an unbelievably impressive complement of weaponry, an absolute death machine.” —Morgan-Freeman-sounding-but-not-Morgan-Freeman narrator — Ted (2012)

We have digressed far into the 3.5th dimension here; apologies, here’s the reason and possible fix!

Reason

NOTE: Just for the sake of clarity, this “Chrome binary” that Selenium is referring to is simply the OG big daddy main “Chrome.exe” file located in Google Chrome’s installation directory.

In previous versions of Google Chrome (v84 and below), Google Chrome’s default installation path—where “Chrome.exe” typically is—used to be:

C:UsersUSERNAMEAppDataLocalGoogle

But since the newer iteration(s) (v85 and above), the default installation path is:

C:Program FilesGoogle

Now, this is the problem. Where the older chromedriver.exe versions (v84 and below) intuitively expect the Chrome binary to be is in the former path, not the latter. If your Google Chrome browser naturally auto-updated from v84 to v85, this path remains unchanged (so chromedriver.exe has no issues navigating to it). However, if you explicitly installed or reinstalled Google Chrome on the latest version (v85 and above) recently, then the installation path changes to the newer one, and so, your older chromedriver.exe is not able to navigate to the Chrome binary; and this makes your code end with that particular “cannot find Chrome binary” exception. Ergo, this is why you are having to explicitly set the “binary_location” to the latter manually

NOTE: Since Google Chrome does not allow customizing the installation path while installing and just directly installs into Program Files by default, We have already tried a workaround and changed the default installation path itself from the registry (regedit); but to no avail, Google Chrome would then completely refuse to work once installed in the desired directory. It seems newer Google Chrome installations can only function if they are installed in the newer installation path.

Possible Fixes

Download the latest chromedriver.exe version that corresponds to your Google Chrome version (from here), and replace your existing chromedriver.exe with this new one.

Your problem should now be solved, since the newer chromedriver.exe is equipped with the knowledge that the new Google Chrome installation path is where it is supposed to look in order to find the Chrome binary.

But—for whatever reason—if you do not want to upgrade the chromedriver.exe version, you could just downgrade your Google Chrome version by obtaining an older version that corresponds to your chromedriver.exe version, uninstalling the newer version, and then installing the older version you had obtained.

NOTE: You will not find any official downloads for older Google Chrome versions since Google does not allow this for security reasons, but you may find some unofficial sources like this (personally tested and verified, safe). Also be informed that upon installing an older version of Google Chrome, auto-updates will no longer work anymore; so the only way for a potential future update would be via an uninstall and manual install of the latest Google Chrome version.

[INFO] --- maven-surefire-plugin:2.20.1:test (default-test) @ Maven.Final ---
[INFO] 
[INFO] -------------------------------------------------------
[INFO]  T E S T S
[INFO] -------------------------------------------------------
[INFO] Running TestSuite


Starting ChromeDriver 2.33.506120 (e3e53437346286c0bc2d2dc9aa4915ba81d9023f) on port 32967
Only local connections are allowed.
FAILED CONFIGURATION: @BeforeClass setUp
org.openqa.selenium.WebDriverException: unknown error: cannot find Chrome binary
  (Driver info: chromedriver=2.33.506120 (e3e53437346286c0bc2d2dc9aa4915ba81d9023f),platform=Windows NT 10.0.15063 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 54 milliseconds
Build info: version: '3.7.1', revision: '8a0099a', time: '2017-11-06T21:01:39.354Z'
System info: host: 'XXXXXXXXXX', ip: 'XXXXXXXXXXX', os.name: 'Windows 10', os.arch: 'XXXXXX', os.version: '10.0', java.version: '1.8.0_131'
Driver info: driver.version: ChromeDriver
 at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
 at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
 at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
 at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
 at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:214)






Let see how to resolve this problem, if we run our project through intellj or eclipse using TestNG or Maven our Script will work fine but when we try to run this using Jenkins the Jenkins could not access the binary from our system, since It is possible that chrome is installed on your AppData folder in C drive, so we need to be sure that jenkins is able to access our chrome binary file.





Now to access the binary file we need to add below snippet







ChromeOptions chromeOptions= new ChromeOptions();
chromeOptions.setBinary("C:\Users\Manish\AppData\Local\Google\Chrome\Application\chrome.exe");
 System.setProperty("webdriver.chrome.driver","C:\Users\manish\Downloads\chromedriver_win32\chromedriver.exe");
 driver = new ChromeDriver(chromeOptions);





i hope this resolve your problem let me know if this won't work for you guys.




Issue

I’m trying to run my test (Selenium+junit+cucumber+Maven) on Jenkins.
In my definition class I’m not pointing to Chrome binary but rather use WebDriverManager:

@Given(«^I navigate to page$»)

public void i_navigate_to_webpage() throws Throwable {

    String url = Helper.getPropValue("landing", "navigation");

    WebDriverManager.chromedriver().setup();
    driver = new ChromeDriver();
    wait = new WebDriverWait(driver,20);

    driver.manage().window().maximize();
    driver.get(url);

}

It works fine on my machine (Win), but when I’m trying to execute this on Jenkins (Ubuntu box), I get error:

org.openqa.selenium.WebDriverException: unknown error: cannot find Chrome binary
(Driver info: chromedriver=2.35.528139 (47ead77cb35ad2a9a83248b292151462a66cd881),platform=Linux 4.4.0-1047-aws x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 687 milliseconds
Build info: version: ‘2.48.2’, revision: ’41bccdd10cf2c0560f637404c2d96164b67d9d67′, time: ‘2015-10-09 13:08:06’
System info: host: ‘ip-172-31-12-150’, ip: ‘172.31.12.150’, os.name: ‘Linux’, os.arch: ‘amd64’, os.version: ‘4.4.0-1047-aws’, java.version: ‘1.8.0_151’
Driver info: org.openqa.selenium.chrome.ChromeDriver
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:206)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:158)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:647)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:247)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:129)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:142)
at org.openqa.selenium.chrome.ChromeDriver.(ChromeDriver.java:170)
at org.openqa.selenium.chrome.ChromeDriver.(ChromeDriver.java:159)
at org.openqa.selenium.chrome.ChromeDriver.(ChromeDriver.java:116)
at GridTest.grid.StepDef.i_navigate_to_webpage(StepDef.java:52)
at ✽.Given I navigate to page(src/test/test.feature:6)

I was under impression that WebDriverManager should have covered that how it does on my Windows machine. Isn’t it so?

My Pom.xml file here:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <groupId>GridTest</groupId>
  <artifactId>grid</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <packaging>jar</packaging>

  <name>grid</name>
  <url>http://maven.apache.org</url>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <suiteXmlFile>testing.xml</suiteXmlFile>
  </properties>
  <build>
    <pluginManagement>
        <plugins>
            <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
            <plugin>
                <groupId>org.eclipse.m2e</groupId>
                <artifactId>lifecycle-mapping</artifactId>
                <version>1.0.0</version>
                <configuration>
                    <lifecycleMappingMetadata>
                        <pluginExecutions>
                            <pluginExecution>
                                <pluginExecutionFilter>
                                    <groupId>
                                        com.lazerycode.selenium
                                    </groupId>
                                    <artifactId>
                                        driver-binary-downloader-maven-plugin
                                    </artifactId>
                                    <versionRange>
                                        [1.0.17,)
                                    </versionRange>
                                    <goals>
                                        <goal>selenium</goal>
                                    </goals>
                                </pluginExecutionFilter>
                                <action>
                                    <ignore></ignore>
                                </action>
                            </pluginExecution>
                        </pluginExecutions>
                    </lifecycleMappingMetadata>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.20.1</version>
            </plugin>
        </plugins>
    </pluginManagement>
  </build>
    <dependencies>
    <dependency>
   <groupId>io.github.bonigarcia</groupId>
   <artifactId>webdrivermanager</artifactId>
    <version>2.1.0</version>
    </dependency>
    <dependency>
        <groupId>com.vimalselvam</groupId>
        <artifactId>cucumber-extentsreport</artifactId>
        <version>3.0.2</version>
    </dependency>
    <dependency>
        <groupId>com.aventstack</groupId>
        <artifactId>extentreports</artifactId>
        <version>3.1.1</version>
    </dependency>
    <dependency>
         <groupId>junit</groupId>
         <artifactId>junit</artifactId>
         <version>4.12</version>
         <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.seleniumhq.selenium</groupId>
        <artifactId>selenium-java</artifactId>
        <version>2.53.1</version>
    </dependency>
    <dependency>
        <groupId>info.cukes</groupId>
        <artifactId>cucumber-java</artifactId>
        <version>1.2.2</version>
    </dependency>
    <dependency>
        <groupId>info.cukes</groupId>
        <artifactId>cucumber-junit</artifactId>
        <version>1.2.2</version>
    </dependency>
   <dependency>
    <groupId>info.cukes</groupId>
    <artifactId>cucumber-core</artifactId>
    <version>1.2.2</version>
  </dependency>
  <dependency>
    <groupId>org.seleniumhq.selenium</groupId>
    <artifactId>selenium-chrome-driver</artifactId>
    <version>2.48.2</version>
  </dependency>

  </dependencies>
</project>

Solution

Your chrome on Ubuntu is not installed into default location:

enter image description here

More detail

you can add the chrome binary to PATH environent variable or reinstall it to default location.

Make sure chromedriver compatible with chrome browser, check this link to get compatible mapping

Chromedriver 2.35 Supports Chrome v62-64

When run script from Linux terminal tunnel, like run by Jenkins.
In general, Linux terminal tunnel not have display screen, but run script with headful model require a physical or virtual display.

Option 1: run with headless model when not setup virtual display by xWindow/xvbf

ChromeOptions options = new ChromeOptions();
options.addArguments("headless");
// Must maximize Chrome by `start-maximized`
options.addArguments("start-maximized");

//Dont maximize Chrome by below line, because has no display
driver.manage().window().maximize()

Option 2: run with headful model, but need setup virtual display for the user which Jenkins used to connect to your Ubuntu box or you setup for all users
if you can’t know which user.

Please read document about Xvbf or other xWindow to setup virtual display.

Answered By — yong
Answer Checked By — Marie Seifert (JavaFixing Admin)

Hello Guys, How are you all? Hope You all Are Fine. Today I am just trying to set my Chrome binary location in my selenium webdriver But I am facing following error WebDriverException: unknown error: cannot find Chrome binary error with Selenium in Python for older versions of Google Chrome in python. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

Contents

  1. How WebDriverException: unknown error: cannot find Chrome binary error with Selenium in Python for older versions of Google Chrome Error Occurs ?
  2. How To Solve WebDriverException: unknown error: cannot find Chrome binary error with Selenium in Python for older versions of Google Chrome Error ?
  3. Solution 1: Use this code
  4. Solution 2: Make sure chrome browser is installed
  5. Summary

I am just trying to set my Chrome binary location in my selenium webdriver But I am facing following error.

WebDriverException: unknown error: cannot find Chrome binary
(Driver info: chromedriver=2.26.436362
(5476ec6bf7ccbada1734a0cdec7d570bb042aa30),platform=Windows NT 10.0.14393 x86_64)

How To Solve WebDriverException: unknown error: cannot find Chrome binary error with Selenium in Python for older versions of Google Chrome Error ?

  1. How To Solve WebDriverException: unknown error: cannot find Chrome binary error with Selenium in Python for older versions of Google Chrome Error ?

    To Solve WebDriverException: unknown error: cannot find Chrome binary error with Selenium in Python for older versions of Google Chrome Error Just make sure that you have chrome browser is installed If you dont have then just Download the browser and it fixes this issue.

  2. WebDriverException: unknown error: cannot find Chrome binary error with Selenium in Python for older versions of Google Chrome

    To Solve WebDriverException: unknown error: cannot find Chrome binary error with Selenium in Python for older versions of Google Chrome Error Just make sure that you have chrome browser is installed If you dont have then just Download the browser and it fixes this issue.

Solution 1: Use this code

Just use following code and you can set your binary path then your error will be solved.

from selenium import webdriver
from selenium.webdriver.chrome.options import Options

options = Options()
options.binary_location = "C:\Program Files\Chrome\chrome64_55.0.2883.75\chrome.exe"
driver = webdriver.Chrome(chrome_options = options, executable_path=r'C:pathtochromedriver.exe')
driver.get('http://google.com/')
print("Chrome Browser Invoked successfully")
driver.quit()

Solution 2: Make sure chrome browser is installed

Just make sure that you have chrome browser is installed If you dont have then just Download the browser and it fixes this issue.

Summary

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you?

Also, Read

  • certificate verify failed: unable to get local issuer certificate

Issue

Had been trying to configure and have met with a lot of trouble, tried a lot of attempt but failed.

  • chromedriver=2.30.477691
  • Chrome 59.0.3071.115
  • Build info: version: ‘3.14.0’
  • Selenium 3.4
  • java.version: ‘1.8.0_121’
  • Linux 3.10.0-229.4.2.el7.x86_64 x86_64

Error:

unknown error: cannot find Chrome binary   (Driver info: chromedriver=2.30.477691 (6ee44a7247c639c0703f291d320bdf05c1531b57),platform=Linux 3.10.0-229.4.2.el7.x86_64 x86_64) (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 59 milliseconds Build info: version: '3.14.0', revision: 'aacccce0', time: '2018-08-02T20:19:58.91Z' System info: host: '8f5b40c32460', ip: 'x', os.name: 'Linux', os.arch: 'amd64', os.version: '3.10.0-229.4.2.el7.x86_64', java.version: '1.8.0_121' Driver info: driver.version: ChromeDriver

Solution

This error message…

unknown error: cannot find Chrome binary   (Driver info: chromedriver=2.30.477691 (6ee44a7247c639c0703f291d320bdf05c1531b57),platform=Linux 3.10.0-229.4.2.el7.x86_64 x86_64) (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 59 milliseconds Build info: version: '3.14.0', revision: 'aacccce0', time: '2018-08-02T20:19:58.91Z' System info: host: '8f5b40c32460', ip: 'x', os.name: 'Linux', os.arch: 'amd64', os.version: '3.10.0-229.4.2.el7.x86_64', java.version: '1.8.0_121' Driver info: driver.version: ChromeDriver

…implies that the ChromeDriver was unable to initiate/spawn a new Browsing Context i.e. Chrome Browser session.

Your main issue is the incompatibility between the version of the binaries you are using as follows:

  • You are using chromedriver=2.30
  • Release Notes of chromedriver=2.30 clearly mentions the following :

Supports Chrome v58-60

  • You are using chrome=59.0
  • Your Selenium Client version is 3.14.0 of 2018-08-02T20:19:58.91Z which is almost 2.5 years older.
  • Your JDK version is 1.8.0_121 which is pretty ancient.

So there is a clear mismatch between JDK v8u121 , Selenium Client v3.14.1 , ChromeDriver v2.30 and the Chrome Browser v59.0


Solution

Ensure that:

  • JDK is upgraded to current levels JDK 8u232.
  • Selenium is upgraded to current levels Version 3.141.59.
  • ChromeDriver is updated to current ChromeDriver v79.0.3945.36 level.
  • Chrome is updated to current Chrome Version 79.0 level. (as per ChromeDriver v79.0 release notes)
  • Clean your Project Workspace through your IDE and Rebuild your project with required dependencies only.
  • If your base Web Client version is too old, then uninstall it through Revo Uninstaller and install a recent GA and released version of Web Client.
  • Take a System Reboot.
  • Execute your @Test as non-root user.
  • Always invoke driver.quit() within tearDown(){} method to close & destroy the WebDriver and Web Client instances gracefully.

Answered By — DebanjanB

 This blog explains one of the issues faced by Test Automation team when executing the UI test scripts using Chrome web driver. Lets have a look at, what is the process Test Automation team followed and the issue encountered. Importantly let’s see how it can be resolved. 

In the UI test scripts developed with Spec flow, Selenium and C#, the purpose is to run automated UI test using a CD pipeline. Team has setup a Azure DevOps agent to run in interactive mode and installed the chrome web browser in the agent VM. Once, pipelines are  executing the UI test automation using the test agent it has reported the following error.

System.AggregateException : One or more errors occurred. (unknown error: cannot find Chrome binary) (unknown error: cannot find Chrome binary)

—- OpenQA.Selenium.WebDriverException : unknown error: cannot find Chrome binary

—- OpenQA.Selenium.WebDriverException : unknown error: cannot find Chrome binary

By looking at the error message, we assumed this issue is due to Azure DevOps, interactive user executing the test in the test agent, couldn’t find the chrome browser installed in the agent machine. However, we have already installed the chrome in the agent machine. 

First we checked the agent configuration process to verify the agent and chrome browser , both configured using the same user and chrome is accessible by the test agent user. We identified that the test agent user can run the Chrome browser manually using the shortcut. However, if we open up the command prompt and type Chrome.exe , it is reporting «Chrome is not recognized as an internal or external command, operable program or batch file». This finding leads to an assumption, the same should have been happening while executing the test scripts. If Chrome.exe is tried in the command prompt from the Chrome installation path, it works fine and opens up a Chrome browser.

With this knowledge, we added the chrome path as the environment variable and restarted the machine. Once, test are executed from the pipelines after setting the path environment variable with the Chrome.exe path, the agent was able to execute the test without any issues. So, it is confirmed the reason for this issue was Chrome.exe could not be located by the user, interactively executing tests in the agent. 

Like this post? Please share to your friends:
  • Org freedesktop dbus error spawn childexited
  • Org apache log4j logger error
  • Oracle ошибка 12705
  • Oracle stream write error
  • Oracle error 01017