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
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 :
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
driver.close();
and always invoke driver.quit()
within tearDown(){}
method to close & destroy the WebDriver and Web Client instances gracefully.@Test
.