Unknown error: cannot find Chrome binary

I have been testing in Firefox for about a month now and I’m trying to expand on the browsers by moving over to Google Chrome. I have no admin rights to my computer and was advised by my IT department to use Chromium, which is an open-source version of Chrome, so I can add the necessary add-ons required for Katalon Studio; otherwise, I need a number of other approvals to get an add-on to Google Chrome. I was able to add the Katalon Recorder to Chrome (chromium) successfully and use the recorder tool. However, when I go back to Katalon Studio, I am unable to use the Spy tool, Record, or Run any tests using Chrome. I have configured the ports and manually added the Chrome browser under Preferences > General > Web Browser. Is there something else I am missing to get this to work? Or perhaps Katalon won’t work with Chromium?

I am using Katalon Studio v5.2.0 and Chromium v65.0 on Windows 7.

Below is the error I am receiving:

Test Cases/New Test Case (1) FAILED because (of) Unable to open browser with url: ‘https://www.katalon.com/’ (Root cause: org.openqa.selenium.WebDriverException: unknown error: cannot find Chrome binary

(Driver info: chromedriver=2.35.528161 (5b82f2d2aae0ca24b877009200ced9065a772e73),platform=Windows NT 6.1.7601 SP1 x86_64) (WARNING: The server did not provide any stacktrace information)

Command duration or timeout: 90 milliseconds

Build info: version: ‘3.7.1’, revision: ‘8a0099a’, time: ‘2017-11-06T21:07:36.161Z’

1 Like

Anyone have any information on this? I can set the binary and update the webdriver properties in the script view so it will open the web browser, but then the test fails saying that the browser is not opened.

How can I set the binary in Katalon Studio itself so it can open the browser where I have it located instead of having to write it in the script?

I have got a similar problem.

My environment is as follows:
- Windows 7 Professional
- Google Chrome 64.0.3282.167
- FireFox 52.6.0
- IE 11.0.9600
- Katalon Studio 5.3.1 Build 1

I read the article [Tutorials>A Sample Web Automation Test Project] at
https://www.katalon.com/resources-center/tutorials/sample-web-automation-test-project/ , and made a TestCase just as described.
I ran it with FireFox successfully.
I ran it with IE successfuly.
I got failure with Google Chrome. The FAILURE message goes as follows:

Test Cases/Basic FAILED because (of) Unable to open browser with url: '' (Root cause: org.openqa.selenium.WebDriverException: unknown error: Chrome failed to start: crashed
  (Driver info: chromedriver=2.35.528161 (5b82f2d2aae0ca24b877009200ced9065a772e73),platform=Windows NT 6.1.7601 SP1 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 60.33 seconds
Build info: version: '3.7.1', revision: '8a0099a', time: '2017-11-06T21:07:36.161Z'
System info: host: ********, ip: '***.***.***.***', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_102'
Driver info: driver.version: CChromeDriver)

Why failed?

I found the chrome.exe installed in the folder C:\Program Files (x86)\Google\Chrome\Application. I believe this is the location where Chrome is installed in Windows 7 as default. I think that the chromedriver would try to find the Chrome binary there unless explicitly specified by the caller.

I tried putting C:\Program Files (x86)\Google\Chrome\Application into the PATH environement variable but it showed no effect.

As an experiment I tried the testcase provided by https://github.com/geb/geb-example-gradle, where I use Gradle+JUnit+Geb+chromedriver+Chrome browser. The testcase ran successfully on my PC. The Chrome browser was actived OK by chromedriver. — well this experiments proves nothing meaningful, I know.

At https://sites.google.com/a/chromium.org/chromedriver/help/chrome-doesn-t-start, the developer of chromedriver suggests that the crash of Chrome often happens when running ChromeDriver/Chrome using a special test harness (in our case Katalon Studio).

Well, then, I would like to know where (in which local folder) Katalon Studio expects the chrome.exe to be found.

Finally I have found a workaround.

The following is my failing TestCase (this was entirely generated by Katalon Studio recorder):

import static com.kms.katalon.core.checkpoint.CheckpointFactory.findCheckpoint
import static com.kms.katalon.core.testcase.TestCaseFactory.findTestCase
import static com.kms.katalon.core.testdata.TestDataFactory.findTestData
import static com.kms.katalon.core.testobject.ObjectRepository.findTestObject
import com.kms.katalon.core.checkpoint.Checkpoint as Checkpoint
import com.kms.katalon.core.checkpoint.CheckpointFactory as CheckpointFactory
import com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords as MobileBuiltInKeywords
import com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords as Mobile
import com.kms.katalon.core.model.FailureHandling as FailureHandling
import com.kms.katalon.core.testcase.TestCase as TestCase
import com.kms.katalon.core.testcase.TestCaseFactory as TestCaseFactory
import com.kms.katalon.core.testdata.TestData as TestData
import com.kms.katalon.core.testdata.TestDataFactory as TestDataFactory
import com.kms.katalon.core.testobject.ObjectRepository as ObjectRepository
import com.kms.katalon.core.testobject.TestObject as TestObject
import com.kms.katalon.core.webservice.keyword.WSBuiltInKeywords as WSBuiltInKeywords
import com.kms.katalon.core.webservice.keyword.WSBuiltInKeywords as WS
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUiBuiltInKeywords
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI
import internal.GlobalVariable as GlobalVariable
import org.openqa.selenium.Keys as Keys
WebUI.openBrowser('')
WebUI.navigateToUrl('http://demoaut.katalon.com/')
WebUI.click(findTestObject('Page_CURA Healthcare Service/a_Make Appointment'))
WebUI.setText(findTestObject('Page_CURA Healthcare Service/input_username'), 'John Doe')
WebUI.setText(findTestObject('Page_CURA Healthcare Service/input_password'), 'ThisIsNotAPassword')
WebUI.click(findTestObject('Page_CURA Healthcare Service/button_Login'))
WebUI.click(findTestObject('Page_CURA Healthcare Service/input_hospital_readmission'))
WebUI.click(findTestObject('Page_CURA Healthcare Service/input_programs'))
WebUI.click(findTestObject('Page_CURA Healthcare Service/span_glyphicon glyphicon-calen'))
WebUI.click(findTestObject('Page_CURA Healthcare Service/td_23'))
WebUI.setText(findTestObject('Page_CURA Healthcare Service/textarea_comment'), 'This is a comment')
WebUI.click(findTestObject('Page_CURA Healthcare Service/button_Book Appointment'))
WebUI.click(findTestObject('Page_CURA Healthcare Service/a_Go to Homepage'))
WebUI.click(findTestObject('Page_CURA Healthcare Service/i_fa fa-bars'))
WebUI.click(findTestObject('Page_CURA Healthcare Service/a_Logout'))
WebUI.closeBrowser()

I edited it as follows:

import static com.kms.katalon.core.checkpoint.CheckpointFactory.findCheckpoint
import static com.kms.katalon.core.testcase.TestCaseFactory.findTestCase
import static com.kms.katalon.core.testdata.TestDataFactory.findTestData
import static com.kms.katalon.core.testobject.ObjectRepository.findTestObject
import com.kms.katalon.core.checkpoint.Checkpoint as Checkpoint
import com.kms.katalon.core.checkpoint.CheckpointFactory as CheckpointFactory
import com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords as MobileBuiltInKeywords
import com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords as Mobile
import com.kms.katalon.core.model.FailureHandling as FailureHandling
import com.kms.katalon.core.testcase.TestCase as TestCase
import com.kms.katalon.core.testcase.TestCaseFactory as TestCaseFactory
import com.kms.katalon.core.testdata.TestData as TestData
import com.kms.katalon.core.testdata.TestDataFactory as TestDataFactory
import com.kms.katalon.core.testobject.ObjectRepository as ObjectRepository
import com.kms.katalon.core.testobject.TestObject as TestObject
import com.kms.katalon.core.webservice.keyword.WSBuiltInKeywords as WSBuiltInKeywords
import com.kms.katalon.core.webservice.keyword.WSBuiltInKeywords as WS
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUiBuiltInKeywords
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI
import internal.GlobalVariable as GlobalVariable
import org.openqa.selenium.Keys as Keys
// Explicitly set the path of Chrome Driver binary
System.setProperty("webdriver.chrome.driver",
"C:\\Katalon_Studio_Windows_64-5.3.0\\configuration\\resources\\drivers\\chromedriver_win32\\chromedriver.exe");
// Explicitly set the path of Chrome Browser binary
import org.openqa.selenium.chrome.ChromeDriver
import org.openqa.selenium.chrome.ChromeOptions
import org.openqa.selenium.remote.DesiredCapabilities
import com.kms.katalon.core.webui.driver.DriverFactory
options = new ChromeOptions();
options.setBinary("C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe");
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(ChromeOptions.CAPABILITY, options);
ChromeDriver driver = new ChromeDriver(capabilities);
DriverFactory.changeWebDriver(driver)
WebUI.navigateToUrl('http://demoaut.katalon.com/')
WebUI.click(findTestObject('Page_CURA Healthcare Service/a_Make Appointment'))
WebUI.setText(findTestObject('Page_CURA Healthcare Service/input_username'), 'John Doe')
WebUI.setText(findTestObject('Page_CURA Healthcare Service/input_password'), 'ThisIsNotAPassword')
WebUI.click(findTestObject('Page_CURA Healthcare Service/button_Login'))
WebUI.click(findTestObject('Page_CURA Healthcare Service/input_hospital_readmission'))
WebUI.click(findTestObject('Page_CURA Healthcare Service/input_programs'))
WebUI.click(findTestObject('Page_CURA Healthcare Service/span_glyphicon glyphicon-calen'))
WebUI.click(findTestObject('Page_CURA Healthcare Service/td_23'))
WebUI.setText(findTestObject('Page_CURA Healthcare Service/textarea_comment'), 'This is a comment')
WebUI.click(findTestObject('Page_CURA Healthcare Service/button_Book Appointment'))
WebUI.click(findTestObject('Page_CURA Healthcare Service/a_Go to Homepage'))
WebUI.click(findTestObject('Page_CURA Healthcare Service/i_fa fa-bars'))
WebUI.click(findTestObject('Page_CURA Healthcare Service/a_Logout'))
WebUI.closeBrowser()

As you can see, the code I inserted explicity specifies a custom location for ChromeDriver to find Chrome Browser:

options.setBinary("C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe");

My workaround ran successful; it successfuly opened Chrome browser, no crash.

However my workaround ran only for Chrome. I can not apply the TestCase to IE and Firefox any longer. This side effect makes my workaround just an experiment.

1 Like

Where Chrome Driver expects Chrome Browser installed? It depends on your OS as documented at https://github.com/SeleniumHQ/selenium/wiki/ChromeDriver

This page show you a table:

OS Expected Location of Chrome
Linux /usr/bin/google-chrome1
Mac /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome
Windows XP %HOMEPATH%\Local Settings\Application Data\Google\Chrome\Application\chrome.exe
Windows Vista C:\Users%USERNAME%\AppData\Local\Google\Chrome\Application\chrome.exe

How about the case of Windows7, Windows10? It seems that the document was written years ago when XP and Vista were main players, and it has not been updated since then, so that it does not mension about the current Windows lineups.

I suppose that Chrome Driver does NOT expect Chrome Browser installed in C:\Program Files (x86)\Google\Chrome\Application\chrome.exe on my Windows 7 PC. So I had to override the Chrome binary location explicity as my workaround code shows.

I would conclude that Katalon Studio should provide a way for user to explicitly specify the Chrome binary location.

4 Likes

kazurayam, thanks a lot for this! I edited the test case to specify the driver and the browser explicitly and it worked.

Hi kazurayam, thanks so much for the detail else i would have been in a situation to leave exploring Katalon as a tool itself. I did tried the explicit code and mentioned the same in the script but still while launching the recording option and selecting the browser is again giving me the same error. but on running the test case alone was a success and the script pass. Any help around this if possible, i am nowhere in a situation to even start knowing the tool and I am not from the scripting background also.

Unknown error:Cannot find Chrome binary (Driver info: chromedriver=2.35.528161…)

purnima,

I did tried the explicit code and mentioned the same in the script but still while launching the recording option and selecting the browser is again giving me the same error. but on running the test case alone was a success and the script pass.

OK, possiblly I can help you. To make my instruction simple and easy to understand, please answer to the following questions.

q1. Are you working on Windows? Mac or Linux?

q2. What is the exact path to the chrome binary on your PC? If you are working on Windows 10, it would be C:\Program Files (x86)\Google\Chrome\Application\chrome.exe . As as yours?

You can explicity specify the location of chrome.exe by Project > Settings > Execution > Default > WebUI > Chrome.

Add a property:

Name | Type | Value
binary | String | C:\Program Files (x86)\Google\Chrome\Application\chrome.exe , or any other path which you actually have
n

specify_chrome_binary_path_explicitly.png

@Katalon team,

I wonder how much you are aware that quite a few people have struggle with the “unknown error: cannot find Chrome binary” problem.

Vinh Nguyen mentioned that one can explicitly specify the location of chrome binary by Project -> Settings -> Execution -> Default -> WebUI -> Chrome
in


So now I know it. But others do not.

I believe Katalon document should cover this know-how in the official document
https://docs.katalon.com/display/KD/Execution+Settings

kazurayam said:

purnima,

I did tried the explicit code and mentioned the same in the script but still while launching the recording option and selecting the browser is again giving me the same error. but on running the test case alone was a success and the script pass.

OK, possiblly I can help you. To make my instruction simple and easy to understand, please answer to the following questions.

q1. Are you working on Windows? Mac or Linux?

q2. What is the exact path to the chrome binary on your PC? If you are working on Windows 10, it would be C:\Program Files (x86)\Google\Chrome\Application\chrome.exe . As as yours?

Please find the answers below:
a1) I am working on windows 7 professional
a2) Yes the path is same “C:\Program Files (x86)\Google\Chrome\Application”

kazurayam said:

You can explicity specify the location of chrome.exe by Project > Settings > Execution > Default > WebUI > Chrome.

Add a property:

Name | Type | Value
binary | String | C:\Program Files (x86)\Google\Chrome\Application\chrome.exe , or any other path which you actually have
n

Tried this but still getting the same error on Spy Web or Record Web.

OK, then.

Try the name ‘chrome.binary’, not ‘binary’

Name | Type | Value
chrome.binary | String | C:\Program Files (x86)\Google\Chrome\Application\chrome.exe

kazurayam said:

OK, then.

Try the name ‘chrome.binary’, not ‘binary’

Name | Type | Value
chrome.binary | String | C:\Program Files (x86)\Google\Chrome\Application\chrome.exe

This is also not working

purnima,

Do you find this file on your PC ? :

C:\Users\%USERNAME%\AppData\Local\Google\Chrome\Application\chrome.exe

kazurayam said:

purnima,

Do you find this file on your PC ? :

C:\Users\%USERNAME%\AppData\Local\Google\Chrome\Application\chrome.exe

yes and this is my office system with restricted rights so i wouldn’t be able to install anything on this but would need to ask the concerned team if something is required to resolve this issue.

purnima,

Now I have got to know that you have Chrome installed in 2 locations:

1. C:\Users\%USERNAME%\AppData\Local\Google\Chrome\Application\chrome.exe

2. C:\Program Files (x86)\Google\Chrome\Application\chrome.exe

This situation is similar to my previous experience. Please have a look at my story at

- http://forum.katalon.com/discussion/6150/google-chrome-crashed-on-my-pc-----2-reasons-found

The latter location is the standard installation path of Chrome on Windows 7.

The former location — why do we have this? I do not know. My PC is an office property as well, which is out of my control.

What is significant for Katalon users is that provided that chrome.exe is

installed multiple locations, the former location takes precedence over the latter.

This precedence rule is implemented in the chromedriver bundled in Katalon Studio. We have no chance to change the rule.

If the chrome.exe in the former location is corrupted or is an old version, Katalon Studio

will have hard time activating Chrome browser.

I believe you should avoid of the former location by changing the path.

Change this:

C:\Users\%USERNAME%\AppData\Local\Google\Chrome\Application\chrome.exe

to:

C:\Users\%USERNAME%\AppData\Local\Google\Chrome**_Application_**\chrome.exe

If you do this, the chromedriver will no longer be confused and will just

use the chrome.exe under C:\Program Files (x86)

I suppose that the version of Chrome.exe at C:\Users\%USERNAME%\AppData\Local\Google\Chrome\Application\chrome.exe on your PC is old.

Katalon Studio can not collaborate with old version of Chrome.

purnima,

You mentioned at 05/01/2018 that:

Tried this but still getting the same error on Spy Web or Record Web.

Have you installed Katalon Addon for Chrome? The document states that the addon is required for Spy Web and Record Web.
https://docs.katalon.com/display/KD/Katalon+Addon+for+Chrome