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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值