You can add the following code at the end of the test script to close the IE driver. Therefore, there is no need to close it manually.
try {
Runtime.getRuntime().exec("taskkill /F /IM IEDriverServer.exe");
} catch (IOException e) {
e.printStackTrace();
}
Open notepad again and paste the following code.
taskkill /F /IM IEDriverServer.exe
Save the file as closedriver.bat
Click this batch file when you want to close the IE driver.
source
share