I had a test script with Selenium RC. Now I don't know what could happen during the test but I want the browser to be shut down if the program is killed accidentally. BTW, the script is running in a sub-process.
Now I tried method __del__ but it doesn't work and I don't see if there's any exceptions. So I have no idea where to put try --- except or with --- in.
If I run the script in main-process it works fine. Any help?
Version of Selenium is 2.33. Browser is Firefox 21.0
make the del method return boolean.
True on success, false otherwise.
If it returns false, close the driver in main.
How can I close the browser when program is killed accidentally in selenium?