Asp.net 如何防止IEDriverServer.exe进程多次启动?
我正在使用Selenium和IE Web驱动程序。每当我的测试开始时,IE驱动服务器也会启动,但在测试完成后不会关闭/退出。因此,在下一次测试运行中,我将看到IEDriverServer.exe进程的多个实例。试运行后如何关闭它 下面是我使用的示例代码:Asp.net 如何防止IEDriverServer.exe进程多次启动?,asp.net,internet-explorer,selenium,selenium-webdriver,Asp.net,Internet Explorer,Selenium,Selenium Webdriver,我正在使用Selenium和IE Web驱动程序。每当我的测试开始时,IE驱动服务器也会启动,但在测试完成后不会关闭/退出。因此,在下一次测试运行中,我将看到IEDriverServer.exe进程的多个实例。试运行后如何关闭它 下面是我使用的示例代码: [TestClass] public class UnitTest1 { [TestMethod] public void TestMethod1() { var ie = new OpenQA.Sele
[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);
}
}
我知道我可以使用ProcessInfo杀死它,但如果有硒溶液就好了。你试过使用ie.Quit
请参阅和
Quit是指完全退出浏览器和驱动程序
“关闭”用于关闭浏览器窗口。这就是为什么在您的案例中,IEDriverServer.exe保持打开状态的原因
IWebDriver.cs
你试过使用ie.Quit
请参阅和
Quit是指完全退出浏览器和驱动程序
“关闭”用于关闭浏览器窗口。这就是为什么在您的案例中,IEDriverServer.exe保持打开状态的原因
IWebDriver.cs
/// <summary>
/// Close the current window, quitting the browser if it is the last window currently open.
/// </summary>
void Close();
/// <summary>
/// Quits this driver, closing every associated window.
/// </summary>
void Quit();
/// <summary>
/// Closes the Browser
/// </summary>
public void Close()
{
this.Execute(DriverCommand.Close, null);
}
/// <summary>
/// Close the Browser and Dispose of WebDriver
/// </summary>
public void Quit()
{
this.Dispose();
}