Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Selenium webdriver does not quit chrome driver

I'm using Selenium webdriver but it don't quit chrome and chrome driver properly . Some of processes staid runner.

code for quitting chrome :

 driver.quit();

code for starting chrome :

 System.setProperty("webdriver.chrome.driver","/<path to chrome driver>/chromedriver");
 ChromeOptions options = new ChromeOptions();
 options.setBinary(new File("/<path to chrome >/google-chrome"));
 driver = new ChromeDriver(options);

Chrome driver version :2.9.248304 Chromium version :40.0.2214.115 Selenium version :2.32 OS: Linux java.version: 1.7.0_71

Thanks in advance , Naira

like image 812
nairavs Avatar asked Mar 18 '15 13:03

nairavs


1 Answers

Are you executing your driver.quit() within a finally block?

System.setProperty("webdriver.chrome.driver","/<path to chrome driver>/chromedriver");
ChromeOptions options = new ChromeOptions();
options.setBinary(new File("/<path to chrome >/google-chrome"));
driver = new ChromeDriver(options);
try
{
    //automated steps
}
finally
{
    driver.quit();
}
like image 178
aholt Avatar answered Sep 18 '22 14:09

aholt