1 import org.openqa.selenium.WebDriver; 2 import org.openqa.selenium.firefox.FirefoxDriver; 3 import org.openqa.selenium.os.WindowsUtils; 4 /* 5 * 结束进程 6 */ 7 public class KillProcess { 8 9 public static void main(String[] args) { 10 //结束进程 11 WindowsUtils.tryToKillByName("firefox.exe"); 12 13 WebDriver dr = new FirefoxDriver(); 14 dr.get("http://www.baidu.com/"); 15 16 } 17 18 }