Selenium: Getting chrome didn't shut down correctly

后端 未结 3 984
南笙
南笙 2021-01-20 05:44

I\'m getting the chrome didn\'t shut down correctly error message when I reopen a chrome browser in my selenium framework.

In the framework I\'m opening the browser

3条回答
  •  难免孤独
    2021-01-20 06:12

    As per your code it would be tough to analyze the reason behind the error chrome didn't shut down correctly without knowing your framework structure. Perhaps a more details about how code block was invoked (i.e. main() or TestNG) would have helped us.

    Having said that there still seems some more factors to look at as follows :

    • If you are using an existing Chrome Profile through user-data-dir ideally you should avoid the switches setExperimentalOption and addArguments for customization as those should be set within the respective Chrome Profile.
    • As you are using an existing Chrome Profile through user-data-dir as per the documentation ChromeDriver - WebDriver for Chrome the path should point the profile directory as follows :

      options.add_argument("user-data-dir=C:/Users/xw20/AppData/Local/Google/Chrome/User Data/Profile 2")
      
    • Here you can find a detailed discussion at How to open a Chrome Profile through Python

    • Avoid using driver.close(); and always invoke driver.quit() within tearDown(){} method to close & destroy the WebDriver and Web Client instances gracefully.
    • Here you can find a detailed discussion at PhantomJS web driver stays in memory
    • Upgrade JDK to recent levels JDK 8u162.
    • Upgrade Selenium to current levels Version 3.11.0.
    • Upgrade ChromeDriver to current ChromeDriver v2.37 level.
    • Upgrade Chrome version to current Chrome v65.x levels.
    • Clean your Project Workspace through your IDE and Rebuild your project with required dependencies only.
    • Use CCleaner tool to wipe off all the OS chores before and after the execution of your test Suite.
    • If your base Web Client version is too old, then uninstall it through Revo Uninstaller and install a recent GA and released version of Web Client.
    • Execute your @Test.

提交回复
热议问题