I have a slightly unexpected result for me with the code below. Each iteration adds approximately 1% to the CPU load. At the moment when I run this test, I have about 5% CPU load, and after exiting the loop for 100 seconds, the CPU load is 60%. But all instances of chromedriver are closed! Why is this happening?
import org.junit.Test;
import org.openqa.selenium.chrome.ChromeDriver;
public class myclass {
@Test
public static void test() throws InterruptedException {
System.setProperty("webdriver.chrome.driver", "chromedriver");
for (int i=0;i<50;i++){
ChromeDriver driver=new ChromeDriver();
driver.quit();
}
Thread.sleep(100000);
}
public static void main(String[] args) throws Exception {
test();
}
}