2

I am using Selenium in C# to automate against Google Chrome. I am using the latest version of Chrome (78.0.3904.70), Selenium.Webdriver (3.141.0), and Selenium.Chrome.Webdriver (77.0.0).

I use: ChromeDriver chrome = new ChromeDriver();. Chrome opens, but does not load correctly, like in the image below, and I am unable to use any Selenium features. What do I need to change to use Chromedriver?

I downloaded ChromeDriver v.78 and have referenced it with new ChromeDriver(v78 path), and it has the same error.

enter image description here

enter image description here

3
  • Unfortunately your webdriver has to match the major version number, so use chromedriver v78: chromedriver.storage.googleapis.com/… Commented Oct 30, 2019 at 21:14
  • I downloaded ChromeDriver v.78 and have referenced it with new ChromeDriver(v78 path), and it has the same error. Commented Oct 30, 2019 at 21:22
  • 1
    Sorry I didn't read your post carefully enough. Remove the browser extension. This is not needed. Commented Oct 30, 2019 at 21:38

1 Answer 1

2

This error message...

Chrome Automation Extension has crashed

along with this error message...

Aw, Snap!

...is observed when ChromeDriver / Chrome is unable to load the default extensions.


Historically, the Automation Extension issue with Chrome Browser surfaced a couple of builds earlier then ChromeDriver v2.32 and you can find a detailed discussion in What has changed on Chromedriver 2.32 regarding loading of the automation extension?

Precisely, to address this error you may have to:

  • Pass either/both of the flags:
    • disable-extensions flag
    • --no-sandbox flag

as argument/s when creating your WebDriver session. Special test environments sometimes cause Chrome to crash when the sandbox is enabled. For detaile watch this space as follows:

var option = new ChromeOptions(); option.AddArgument("disable-extensions"); option.AddArgument("--no-sandbox"); driver = new ChromeDriver(option); 

Additionally, you need to ensure that (whichever is applicable):

  • JDK is upgraded to current levels JDK 8u222.
  • Selenium is upgraded to current levels Version 3.141.59.
  • ChromeDriver is updated to current ChromeDriver v78.0 level.
  • Chrome is updated to current Chrome Version 78.0 level. (as per ChromeDriver v78.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 and install a recent GA and released version of Web Client.
  • Take a System Reboot.
  • Execute your @Test as non-root / non-administrator user.
  • Always invoke driver.quit() within tearDown(){} method to close & destroy the WebDriver and Web Client instances gracefully.
Sign up to request clarification or add additional context in comments.

1 Comment

option.AddArgument("--no-sandbox"); was all I needed. Thanks for your help!

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.