标签:方法 public webdriver nts quit bdr wait and comm
/**
* 执行dos命令
* @param command
*/
public static void command(String command) {
try {
Runtime.getRuntime().exec(command);
// process.waitFor();
} catch (IOException e) {
e.printStackTrace();
}
}
//退出浏览器并杀死chrome进程
public static void chromeQuit(WebDriver driver){
driver.quit();
Utils.command("taskkill /F /im " + "chromedriver.exe");
Utils.command("taskkill /F /im " + "chrome.exe"); //异常退出杀死chromedriver和chrome浏览器!
}
标签:方法 public webdriver nts quit bdr wait and comm
原文地址:http://www.cnblogs.com/hxm154/p/6182371.html