In the Katalon Forum you can find many posts where people had problem activating Google Chrome browser from Katalon Studio. In most cases the discussion tends to fall unproductive due to lack of enough information(diagnostic) what’s going on between Katalon Studio and Chrome browser.
# chromedriver.log file
Katalon Studio executes the [chromedriver](https://sites.google.com/a/chromium.org/chromedriver/) in order to open Google Chrome browser. Chromedriver can write logs. The [documentation](https://sites.google.com/a/chromium.org/chromedriver/logging) tells you how to enable chromedriver logging.
Let me show you a fragment of a chromedirver.log file here: this shows the command line to start chrome.exe. In other words you can see in detail how Katalon Studio tried to start and communicate with the Chrome browser:
[1526012674.637][INFO]: Launching chrome: "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --disable-background-networking --disable-client-side-phishing-detection --disable-default-apps --disable-hang-monitor --disable-popup-blocking --disable-prompt-on-repost --disable-sync --disable-web-resources --enable-automation --enable-logging --force-fieldtrials=SiteIsolationExtensions/Control --ignore-certificate-errors --load-extension="C:\Katalon_Studio_Windows_64-5.4.1\configuration\resources\extensions\Chrome\Object Spy,C:\Users\username\AppData\Local\Temp\scoped_dir10832_12653\internal" --log-level=0 --metrics-recording-only --no-first-run --password-store=basic --remote-debugging-port=12067 --test-type=webdriver --use-mock-keychain --user-data-dir="C:\Users\username\AppData\Local\Temp\scoped_dir10832_25782" data:,
Please find a example chromedriver.log file attached to this post where you can find what level of detail is available.
# Problem to solve
If I want to get chromedriver.log when I run a Test Case, I can enable chromedriver’s logging feature by setting JVM System Property `webdriver.chrome.logfile` as follows:
System.setProperty('webdriver.chrome.logfile', "C:/temp/chromedriver_TC1.log") WebUI.openBrowser('') // execute some steps WebUI.navigateToUrl('http://demoaut.katalon.com') WebUI.verifyElementPresent(findTestObject("Page_CURA Healthcare Service/a_Make Appointment"), 20) // close the browser WebUI.closeBrowser()
Provided with this level of detail diagnostics, the discussions in the Katalon Forum regarding failures around Chrome browser could be more productive.
OK, this works fine when I run a Test Case.
However, how can I get the chromedriver.log file when I use the Record/Spy Web features? Because in Record/Spy Web, I have no chance to write Groovy script to set Java VM System Property.
In the directory where you installed the Katalon Studio, you will find a file named `katalon.ini`. In this file a few arguments are written which are passed to the Java VM for the Katalon Studio. I tried sightly modify the `katalon.ini` as follows:
-startup plugins/org.eclipse.equinox.launcher_1.3.201.v20161025-1711.jar --launcher.library plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.401.v20161122-1740 -data config -vmargs -Xms256m -Xmx4048m -Dwebdriver.chrome.logfile=C:/temp/chromedriver.log
Please note the very last line above. With -D argument I could specify a JVM System Property `webdriver.chrome.logfile` which is effective even when I run the Record/Spy Web features.
This worked fine for me. I could get chromedriver.log file for Record/Spy Web as well as Test Cases.
# Please bear it in mind that …
The `katalon.ini` file seems to be very fragile. If you make any mistake in `katalon.ini`, unpredictable erros may occur. For example, I experienced a problem when I wrote as follows:
Beware, the double quotations around the file path made katalon.exe crasy.
Also you should be aware that the Katalon Official document does not cover ‘katalon.ini’ file. Presumably they do not like users to touch this at all. This is why I put this post into the “tricks” category .
Hope this helps.