I\'m using selenium webdriver(for Internet Explorer). What it does it basically opens a webpage in internet explorer and does form submitting.
How can I kill intern
Close browser:
try{
WebDriver driver = new InternetExplorerDriver();
.. write all the webdriver code here like driver.get, driver.findElement().click() etc. etc.
}
catch(Throwable webDriverException){
if(webDriverException.getMessage().contains("org.openqa.selenium.WebDriverException: Error communicating with the remote browser. It may have died"){
// Kill IEDriverServer.exe process
// Using WebDriver WindowUtils utility
WindowsUtils.killByName("IEDriverServer.exe");
// Or using JavaRunTime
Runtime.getRuntime().exec("taskkill /F /IM IEDriverServer.exe")
}
}
See if this helps!!!