简体   繁体   中英

Selenium Crashing: Chrome automation extension has crashed

I am using Selenium web drivers, and today, for no apparant reason I started getting an error with the message"Chrome Automation Extension has crashed. Click this balloon to reload the extension".

The only thing I can think of is I added an extension for testing XPath to Chrome today. But it was working fine for a while after I added that.

Could it be some Chrome security issue?

在此处输入图片说明

I had the same problem, I could resolve it as the following:
1.Don't run Chrome as Admin.
2.Don't run your selenium App as Admin.

Ok, so you are serious about the admin part as a solution to the problem?

Why not follow the advices from Google ? http://chromedriver.chromium.org/help/chrome-doesn-t-start

Passing '--no-sandbox' flag when creating your WebDriver session. Special test environments sometimes cause Chrome to crash when the sandbox is enabled.

So I ended up doing as they adviced and can run things as admin . Guess it's a way forward for me now and hopefully it's a valid solution for others too.

var options = new ChromeOptions();
options.AddArgument("--no-sandbox");
browser = new ChromeDriver(options);

My problem was that my Windows temp folder was on a drive (D) that is not my primary Windows drive (C) and that I had also mapped that drive to a sub-folder of C.

  1. I went into Disk Management
  2. Right-clicked my secondary drive
  3. Selected "Change drive letter and paths"
  4. Removed the entry where I had mounted the drive as a folder
  5. Opened my Environment Settings
  6. Changed my TEMP and TMP entries from "C:\\Temp" (the path where my 2nd drive was mounted) to "D:\\"
  7. Restarted my computer

Note that step #4 was important. The plugin would still crash if this was present.

我有同样的问题,但我的情况是我试图用不同的配置文件打开 Visual Studio。当我打开带有默认配置文件的 Visual Studio 时,它工作正常。所以我猜是它的配置文件问题。

我在没有管理员权限的情况下启动 Git Bash 时解决了我的问题。

I had the same issue, using Python with Selenium

options = webdriver.ChromeOptions();
options.add_argument("--no-sandbox")
driver = webdriver.Chrome(options=options,executable_path="../drivers/chromedriver.exe")

The above piece of code resolved my issue

We faced the same problem. For work around we are using Firefox now. You just need to add Selenium.Firefox.WebDriver by jbaranda NuGet package

I had the same problem. In my case it was related to the Windows account I use to log in to Windows, which is account in the Administrators group. However, it was not desirable to change the account type.

To solve this I created a new local account under the control panel (of type 'power user') and used that account to run Chrome and it worked fine.

For Python this solved my problem use:

from selenium import webdriver

# start the browser
options = webdriver.ChromeOptions()
# options.add_argument("--headless")
options.add_argument("--no-sandbox")
# options.add_argument("--disable-dev-shm-usage")
# options.add_argument("--disable-gpu")
# options.add_argument("--window-size=1920,1080")

driver = webdriver.Chrome(options=options)
driver.get("https://www.google.com")

print(driver.title)
print(driver.current_url)

#driver.quit() # Uncoment to keep chromedriver open.

In my case I have to run it under Admin, I fixed it by updating .NET framework. You can update this in Windows Update. I updated every item that is related to .NET framework, including crucial ones and optional ones.

Here are two items I updated:

2018-01 Preview of Quality Rollup for .NET framework (KB4057272)

.NET framework 4.7.1 (KB4033369)

Hope this helps

Edit: I run Win 10 with chromedriver 2.34 and Chrome v64.0.3282.140(64-bit)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM