Handling exception that occurs in htmlunit driver
@@ -68,9 +68,9 @@ protected void finished(Description description) {
if (! mainWindow.equals(driver.getWindowHandle())) {
driver.close();
}
+ driver.switchTo().window(mainWindow);
} catch (Exception ignore) {
}
- driver.switchTo().window(mainWindow);
super.finished(description);
}
};
