做UI自动化一直启动不成功Chrome 报错:请停用以开发者模式......

1、遇见这个问题,先看看是否chromedriver没生效

2、找到代码对应目录,下载chrome对应版本的chromedriver替换进去

package com.sf.acsp.ebill.testcase;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
//import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.chrome.ChromeDriver;

public class Test {
public static void main(String[] args)
{
WebDriver driver;
System.setProperty("webdriver.chrome.driver", "C:\\Program Files (x86)\\Google\\Chrome\\Application\\chromedriver.exe");
//这里的驱动路径一定要写双斜杠,转义
driver = new ChromeDriver();
driver.get("https://www.baidu.com");
}
}

posted @ 2018-09-15 13:56  恋恋青柠  阅读(280)  评论(0编辑  收藏  举报