Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/selenium/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Selenium c#如何停止该操作。执行测试后的exe文件_C#_Selenium_Selenium Webdriver - Fatal编程技术网

Selenium c#如何停止该操作。执行测试后的exe文件

Selenium c#如何停止该操作。执行测试后的exe文件,c#,selenium,selenium-webdriver,C#,Selenium,Selenium Webdriver,我有运行.exe文件的测试脚本(处理我的windows身份验证),在执行测试时,我退出了驱动程序(这意味着关闭浏览器并杀死.exe文件),但它不起作用 .exe文件: Process.Start("c:\\AutoIT\WindowshandleAuthentication.exe") 离开司机 driver.quit(); 它不会停止.exe的运行 我想同时关闭浏览器和.exe文件。有什么解决方案吗?我认为您需要终止该过程:“WindowshandleAuthentic

我有运行.exe文件的测试脚本(处理我的windows身份验证),在执行测试时,我退出了驱动程序(这意味着关闭浏览器并杀死.exe文件),但它不起作用

.exe文件:

Process.Start("c:\\AutoIT\WindowshandleAuthentication.exe")
离开司机

driver.quit();
它不会停止.exe的运行


我想同时关闭浏览器和.exe文件。有什么解决方案吗?

我认为您需要终止该过程:“WindowshandleAuthentication.exe”是您创建的应用程序吗?如果是这样,您可以修改它,使其在收到击键时关闭。然后在调用“driver.quit()”之后,向“WindowshandleAuthentication.exe”发送一个击键
// Start WindowshandleAuthentication.
Process process = Process.Start("WindowshandleAuthentication.exe");
// Wait one second.
Thread.Sleep(1000);
// End WindowshandleAuthentication.
process.Kill();