Google Chrome crashed on my PC --- 2 reasons found

chrome

#1

Here I am NOT going to claim a bug.

I just record a problem I encountered and describe the reasons

I have found out. I hope this helps someone who encountered similar problem.

# Environment

- OS : Windows 7

- Katalon Studio version : 5.3.1

- Katalon Studio log: not relevant

- chromedriver.log: attached

- Browser: Google Chrome: 65.0.3325.181

# Steps to reproduce

On my PC in the office,

- start Katalon Studio

- create New Sample Project > Sample WebUI Testing Project

- `CURA Test Project` is created.

- select test case `TC1_Verify Successful Login` and run it with Google Chrome

- The test case fails after waiting for 60 seconds. Message:

Unable to open browser with rul: 'http://demoaut.katalon.com' 
(Root cause: org.openqa.selenium.WebDriverException:
unknown error: Crhome 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:61.90 seconds
...)

- Screenshot attached.

# Expected behavior

Google Chrome browser runs.

# Actual behavior

Google Chrome browser crashed.

# What I have found

I found 2 reasons unique to my PC.

## ChromeDriver looked for chrome.exe at wrong path

1. The PC is a property of the Corporation I work for. It was setup by the Administration team.

Chrome browser was installed by them.

2. On my PC I found Chrome installed in multiple locations.

- **C:\\Users\\uuuuu\\AppData\\Local\\Google\\Chrome\\Application\\chrome.exe**

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

3. The Chrome under the `Program Files` directory runs OK.

4. The Chrome under the `AppData` directory was somehow corrupted. When I tried to execute it in the command line, it crashed.

5. I collected chromedriver.log. In there I found following record:

[1523843474.260][INFO]: Launching chrome: "C:\Users\qcq0264\AppData\Local\Google\Chrome\Application\chrome.exe" ... --disable-extensions ...

6. This record implies that the chrome driver wanted

to start Chrome under the `AppData` directory which is corrupted and never runs.

7. I checked the [source code of chromedriver](https://github.com/bayandin/chromedriver/blob/master/chrome/chrome_finder.cc) and found that

actually chromedriver gives higher precedence to the one under `AppData`.

My fix was to avoid the corrupted Chrome by renaming the `Application` directory to \_Application\_.

Once the corrupted Chrome has been removed, chrome driver picked up chrome.exe under `Proguram Files` directory.

This is what I wanted to do.

## Was unable to disable a hiper-powered extension for PC Administration

1. According to chromedriver.log file, ChromeDriver generated a command like this:

[1523845407.787][INFO]: Launching chrome: "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" ... --disable-extensions ... 

2. --disable-extensions switch is significant. With this switch specified, Chrome browser tries to disable all extensions on startup.

3. I checked the list of extensions installed in the Chrome of my PC. I found an extension was installed by the Administratin team.

The extension was setup *unable to disable* for ordinary users. This is due to Corporate’s security policy.

4. I think that Chrome crashes because of conflicting instruction. --disable-extensions switch tells Chrome to disable all the extensions. But one of the installed extensions was resisting, therefore Chrome got unable to turn it off. Screenshot attached:

So that Chrome got crazy and crashed away.

I have no countermeasure with this conflict. I can not remove the extension. I can not change the behavior of chromedriver.

Hence I gave up using Chrome with Katalon Studio on my office PC. I am OK because I have understood the reason why Chrome crashes.

Chrome_failed_to_start_crashed.png

chromedriver.log

ExtensionUnableToDisable.png


Does Katalon Studio support react.js applications
Chrome Driver, unable to navigate
I can not start Chrome from Katalon.
Please remove unnecessary --disable-extensions --disable-extensions-except switches for chrome.exe
#2

I am going to add info. I found an article in the Chrome’s official documents:

[Configure the list of force-installed apps and extensions

](https://getadmx.com/?Category=Chrome&Policy=Google.Policies.Chrome::ExtensionInstallForcelist)specifies a list of apps and extensions that are installed silently,
without user interaction, and which cannot be uninstalled nor
disabled by the user.

My PC is company’s property, it is administrated by the specialists. They installed a special extension into the Chrome as a ForceInstalledExtension. I cloud check it by looking at Windows Registry HKEY_LOCAL_MACHINE \ SOFTWARE \ Policies \ Google \ ExtensionInstallForcelist and ExtensionInstallWhitelist, such as this

The problem is that Katalon Studio can not disable the ForceInstalledExtension.

ChromeForceInstalledExtensions.png


#3
chromedriver invoked by Katalon Studio ver 5.4.1 generates a commandline like this:
"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" ... --disable-extensions ..I want to remove '--disable-extensions' switch.If I could do it, I would be able to use Chrome on my company PC.

#4

Chrome always crashes on my corporate’s PC. This incident has been my personal itch for the last 4 months. Finally I have managed to find a workaround, and succeeded to use Chrome with Katalon Studio on my corporate’s well-administrated PC.

The idea is as follows:

  1. I won’t rely on Katalon Studio for opening Chrome browser.
  2. Rather, my test case should instantiate org.selenium.org.openqa.selenium.chrome.ChromeDriver. Here I will NOT specify --disable-extensions switch.
  3. My test case should let Katalon Studio to use the ChromeDriver instance for running tests. This can be done by calling com.kms.katalon.core.webui.driver.DriverFactory#changeWebDriver() method.

Following snippet shows how to:

import org.openqa.selenium.WebDriverimport org.openqa.selenium.chrome.ChromeDriverimport com.kms.katalon.core.webui.driver.DriverFactory
// Test Listener TS1 sets System.setProperty('webdriver.chrome.driver', <path to chromedriver.exe>)
// open Chrome browser and let Katalon Studio to use it
WebDriver driver = new ChromeDriver()
DriverFactory.changeWebDriver(driver)
// execute some steps
WebUI.navigateToUrl('http://demoaut.katalon.com')
WebUI.verifyElementPresent(findTestObject("Page_CURA Healthcare Service/a_Make Appointment"), 20)
// close the browserWebUI.closeBrowser()

This worked fine.

I made a sample project here and exposed public:


Please remove unnecessary --disable-extensions --disable-extensions-except switches for chrome.exe
#5

@4280-kazurayam Thank you. I wanted to know about the path for chromdriver.exe? What should be this path in my machine. In another post of yours i saw path as "…/katalonVersion/configuraion/…’ . On my machine i dont have anything like that, can you please suggest?


#6

In another post of yours i saw path as "…/katalonVersion/configuraion/…’ .

I was talking about the case on Windows.

Nitin,

Which OS are you working on? If Windows you would not say you dont find …/katalonVersion/configuration/…
Possiblely you are on Mac OSX. In my Mac OSX, I find the chromedriver binary at:

/Applications/Katalon Studio.app/Contents/Eclipse/configuration/resources/drivers/chromedriver_mac/chromedriver

The Finder of Mac disables you to look into the “Katalon Studio.app” directory, so that you need to use the Terminal to look into the directory using Shell interaction.


#7

Nitin,

The following code in a test case will tell you something useful

import com.kms.katalon.core.webui.driver.DriverFactoryWebUI.comment("browser type:${DriverFactory.getExecutedBrowser()}")WebUI.comment("chromedriver path:${DriverFactory.getChromeDriverPath()}")WebUI.comment("geckodriver path:${DriverFactory.getGeckoDriverPath()}")