Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

enter image description here

like image 494
Daniel Williams Avatar asked Dec 08 '15 19:12

Daniel Williams


People also ask

Why do my Chrome extensions keep crashing?

Uninstall and reinstall Updating Chrome isn't the same as uninstalling it. Sometimes files associated with an application can cause it to crash or interact badly with extensions or websites. If you're at this stage of the list and Chrome keeps on crashing, it might be time to uninstall and reinstall your browser.

Can you use Selenium in a chrome extension?

Testing a browser extension - be it Chrome, Firefox, Safari, Opera, or Internet Explorer - is a different matter altogether. In this article, I'm specifically showing you how to test a Chrome Extension with Selenium, but the same principle can be applied to Firefox, Internet Explorer, and Safari.


2 Answers

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.

like image 155
Mohammad Dayyan Avatar answered Oct 22 '22 15:10

Mohammad Dayyan


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); 
like image 33
Jonas Carlbaum Avatar answered Oct 22 '22 14:10

Jonas Carlbaum