/**
* 执行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浏览器!
}