Ideally, each of your tests will start with a clean state, without any existing Firefox or IE processes. In the test tearDown () methods, you must close / exit the browser. Even with this approach, wandering processes can sometimes occur. If you use a Selenium server on Windows using Java RC, this command in the startUp () method can guarantee that browsers / instances will not be executed:
Runtime.getRuntime().exec("TASKKILL /F /IM Firefox.exe"); Runtime.getRuntime().exec("TASKKILL /F /IM iexplore.exe");
Regarding crash detection, Firefox displays a crash warning dialog box. You can programmatically interact with this window using external tools such as AutoIT, which can automatically click the OK button in this dialog box if you need to. I found that creating an external AutoIT script that constantly runs in the background to handle pop-ups, crashes, warnings, etc., is very useful.
Nathanchristie
source share