How to kill IEDriverServer.exe console window after running an InternetExplorerDriver Selenium test

Viewed 7419

I'm running Selenium Webdriver through a Visual Studio Unit Test and using the InternetExplorerDriver. This fires up IEDriverServer.exe in a console window.

This works great and the test executes. Once test execution finishes i'd like that cmd.exe window killed so that it's not hanging around for me to have to do manual cleanup. I have thousands of tests so you can imagine the headache of managing this.

Is there an elegant way to handle this without having to do post test execution and killing cmd.exe processes with kill.exe, etc? I've tried InternetExplorerDriverService.HideCommandPromptWindow = true, but that just runs cmd.exe in hidden mode and leaves the process running until it's manually killed. I've also tried InternetExplorerDriverService.SuppressInitialDiagnosticInformation and all that does is suppress some of the information written to the cmd.exe window.

3 Answers
Related