asp.net - How to prevent IEDriverServer.exe process to launch multiple times? -
i'm using selenium , ie web driver. whenever test starts, ie driver server starts too, doesn't close/exit after test finishes. next test run, end multiple instances of iedriverserver.exe
processes sitting around. how close after test run?
below sample code use:
[testclass] public class unittest1 { [testmethod] public void testmethod1() { var ie = new openqa.selenium.ie.internetexplorerdriver(new openqa.selenium.ie.internetexploreroptions() { introduceinstabilitybyignoringprotectedmodesettings = true }); ie.navigate().gotourl("http://localhost:50640/"); ie.close(); ie.close( assert.istrue(true); } }
i know can use processinfo
kill it, it'll nice have selenium solution.
have tried using ie.quit();
?
please refer documentation , source code.
quit()
1 quit (the browser , driver).
close()
closing browser window. why here in case, iedriverserver.exe
left open.
iwebdriver.cs
/// <summary> /// close current window, quitting browser if last window open. /// </summary> void close(); /// <summary> /// quits driver, closing every associated window. /// </summary> void quit();
remotewebdriver.cs
(which base class of internetexplorerdriver.cs
)
/// <summary> /// closes browser /// </summary> public void close() { this.execute(drivercommand.close, null); } /// <summary> /// close browser , dispose of webdriver /// </summary> public void quit() { this.dispose(); }
Comments
Post a Comment