Selenium Crashing: Chrome automation extension has crashed

后端 未结 10 1384
花落未央
花落未央 2020-12-29 22:05

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

相关标签:
10条回答
  • 2020-12-29 22:15

    I resolve my problem when I start Git Bash without admin rights.

    0 讨论(0)
  • 2020-12-29 22:18

    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.

    0 讨论(0)
  • 2020-12-29 22:22

    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.
    
    0 讨论(0)
  • 2020-12-29 22:25

    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.

    0 讨论(0)
  • 2020-12-29 22:30

    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);
    
    0 讨论(0)
  • 2020-12-29 22:30

    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

    0 讨论(0)
提交回复
热议问题