I've got a PyQt QThread that's running a worker object, and as one of the duties of the worker object, it instantiates and uses a selenium webdriver (Firefox in this case).
I've also got a PyQt slot on that worker object that needs to cleanly teardown the object. Since the worker "owns" the webdriver, it needs to be able to kill it at any time. Calling webdriver.quit()
only causes the webdriver to quit some of the time, exclusively after the webdriver is fully set up. Tracing the issue through the call stack of Selenium's source code makes me think that the issue happens when I try to execute Command.QUIT
on the remote webdriver. If its remote command executor hasn't instantiated yet, then naturally it can't quit.
How can I be absolutely certain that selenium has torn down?