您的位置:首页 > 产品设计 > UI/UE

使用driver.quit()的时候,有时会报错

2015-12-18 12:29 986 查看

运行到driver.quit()的时候,会有以下报错信息:

十二月 18, 2015 12:31:58 下午 org.openqa.selenium.os.UnixProcess$SeleniumWatchDog destroyHarder

信息: Command failed to close cleanly. Destroying forcefully (v2). org.openqa.selenium.os.UnixProcess$SeleniumWatchDog@98ac89

解决方法:
1. Downgrade your FF version. 降低Firefox的版本

2. Delete plugin-container.exe from C:\Program Files\Mozilla Firefox\plugin-container.exe.

   删除plugin-container.exe文件

3. Use the code below 添加以下函数

public void closeBrowserSession() throws IOException {

Runtime.getRuntime().exec(“taskkill /F /IM chrome.exe”);

Runtime.getRuntime().exec(“taskkill /F /IM iexplorer.exe”);

Runtime.getRuntime().exec(“taskkill /F /IM firefox.exe”);

}

This will run on windows only.

方法1和2好用,3不好用。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  webdriver