TestNG:org.openqa.selenium.os.UnixProcess$SeleniumWatchDog错误
?? 在TestNG運行自動化測試用例的時候,瀏覽器FireFox正確打開,可是在測試用例運行完成后,我調用的是webdriver.quit()關閉程序的,結果卻報以下錯誤:
?? Sep 25, 2014 4:19:32 PM org.openqa.selenium.os.UnixProcess$SeleniumWatchDog destroyHarder
INFO: Command failed to close cleanly. Destroying forcefully (v2).? org.openqa.selenium.os.UnixProcess$SeleniumWatchDog@e3226
關閉不太成功啊,還彈出了個對話框,提示關閉程序。在網上搜了一下,有如下三個方法可以解決:
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.
?
為了省事,我用的是第二個方法,刪除了plugin-container.exe文件,再次運行成功!!
?
轉載于:https://www.cnblogs.com/eagleking0318/p/6520914.html
總結
以上是生活随笔為你收集整理的TestNG:org.openqa.selenium.os.UnixProcess$SeleniumWatchDog错误的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 额,看看吧
- 下一篇: sql 2005提示未能加载包Micro