selenium exceptionin java (org.openqa.selenium.remote.UnreachableBrowserException)

来源:互联网 发布:程序员专用昵称 编辑:程序博客网 时间:2024/06/04 19:18

selenium exceptionin java (org.openqa.selenium.remote.UnreachableBrowserException)解决方法:

  1. 下载chromedriver.exe,而不是指定使用chrome.exe。下载地址:http://chromedriver.storage.googleapis.com/
  2. 在代码中指定使用 chromedriver.exe

具体代码如下:

        WebDriver dr;        String key = "webdriver.chrome.driver";//      String value = "C:/Program Files (x86)/Google/Chrome/Application/chrome.exe";        String value = "D:/常用软件/chromedriver_win32/chromedriver.exe";        System.setProperty(key, value);        dr = new ChromeDriver();        dr.manage().window().maximize();//      dr.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);        dr.get("http://www.baidu.com");
0 0
原创粉丝点击