美文网首页我爱编程
selenium杀掉Windows浏览器的进程

selenium杀掉Windows浏览器的进程

作者: 红木杉2018 | 来源:发表于2017-04-18 16:54 被阅读0次

package LianXi;

import org.openqa.selenium.WebDriver;

import org.openqa.selenium.By;

import org.openqa.selenium.chrome.ChromeOptions;

import org.openqa.selenium.chrome.ChromeDriver;

import org.openqa.selenium.os.WindowsUtils;

public class KillProcess {

public static void main(String[] args) {

// TODO Auto-generated method stub

ChromeOptions options=new ChromeOptions();

options.addArguments("--start-maximized","allow-running-insecure-content","--test-type");

ChromeDriver dr=new ChromeDriver(options);

dr.get("https://www.baidu.com");

//杀掉谷歌浏览器进程

WindowsUtils.tryToKillByName("chrome.exe");

}

}

相关文章

网友评论

    本文标题:selenium杀掉Windows浏览器的进程

    本文链接:https://www.haomeiwen.com/subject/dhcqzttx.html