My program launches several dozen instances of WebDriver
in parallel and kills them when certain conditions are met or when I manually terminate the program. At any given time I might have 4 dozen active WebDriver
instances and to kill unwanted instances I call:
driver.quit();
If driver.quit();
throws exception I kill WebDriver
by PID via Runtime.getRuntime().exec() taskkill
command.
Most of the active drivers are destroyed with this call (when I exit program). However, there's usually a handful (1-3) that 'hang' with the message Mozilla FireFox (Not Responding)
. And they never die.
I'm unable to determine the root cause of the issue as the command I'm using to kill WebDriver
is generally working. I've looked at several threads on SO regarding similar issues but I feel none of them address my problem because, as stated, the command I'm using works in general - it's just not working on all instances. As far as I see, there's is no difference between the way any of the drivers operate. Also, no error/exception is thrown when I call driver.quit()
. So it seems purely random when the command works and doesn't work.
What might cause Firefox to hang like this and not respond to quit()
command?
Thanks!