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文件,再次运行成功!!

 

posted @ 2015-01-20 15:38  潜龙9527  阅读(321)  评论(0编辑  收藏  举报