Quantcast
Channel: Active questions tagged selenium - Stack Overflow
Viewing all articles
Browse latest Browse all 97980

Selenium initiated ChromeDriver keeps running in background

$
0
0

I am not able to completely delete a project, because the chromedriver instance is running in the background, even when there is no code is being executed.Please see the below image.Task Manager Process View

The error I get while the project deletion is:Eclipse error while project deletion

Take the below code for instance:

import java.util.concurrent.TimeUnit;import org.openqa.selenium.WebDriver;import org.openqa.selenium.chrome.ChromeDriver;public class Test {    public static void main(String[] args) throws Exception {        String url = "https://www.google.com";        System.setProperty("webdriver.chrome.driver", "src/driver/chromedriver.exe");        WebDriver driver = new ChromeDriver();        driver.manage().window().maximize();        driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);        driver.get(url);        System.out.println(driver.getTitle());    }}

Try running this code, say 5 times, and there will be 5 background running instances. Tried restarting Eclipse, with no luck.

I understand this is happening because I am not writing this line:

driver.close();

But normally, when the main-thread dies, all supporting running instances should die with it.

Is this a known issue, or I am scripting something wrong.

Thanks in advance.


Viewing all articles
Browse latest Browse all 97980

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>