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

How to close all opened drivers in Selenium?

$
0
0

I need to close all open Chrome drivers in Selenium. All my methods are closing only one of them. The reason why I need to close all drivers at the same time - in the start of my program I don't know how many drivers I need to open, so I try to open a few drivers with same driver names in cycle.

How I opened these drivers:

WebDriver driver = new ChromeDriver();driver.get(firstURL);driver = new ChromeDriver();driver.get(secondURL);

How I tried to close both drivers:

First try:

driver.close();

Second try:

driver.quit();

Third try:

driver.close();driver.close();

Fourth try:

driver.quit();driver.quit();

Viewing all articles
Browse latest Browse all 97986

Trending Articles



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