我正面临这个问题; 我知道这个问题已经出现了,我已经尝试了所提到的解决方案,因此请问我的配置和代码.
之前脚本正在运行,但现在它们不是,所以我尝试制作一个基本的开放浏览器脚本.
最新版本的Selenium WebDriver:http://selenium-release.storage.googleapis.com/3.5/selenium-java-3.5.0.zip
ChromeDriver上的最新版本:http://chromedriver.storage.googleapis.com/index.html?path = 2.31 /
基本打开浏览器代码:
package Trial;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
public class Trial_Class {
public static void main(String args[]){
System.setProperty("webdriver.chrome.driver", "chromedriver.exe");
WebDriver driver = new ChromeDriver();
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
driver.get("http://www.youtube.com");
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
}
}
Run Code Online (Sandbox Code Playgroud)
但我仍然得到以下错误:
Starting ChromeDriver 2.31.488763 (092de99f48a300323ecf8c2a4e2e7cab51de5ba8) on port 43967
Only local connections are allowed.
Exception in thread "main" org.openqa.selenium.WebDriverException: chrome not reachable
(Driver info: chromedriver=2.31.488763 (092de99f48a300323ecf8c2a4e2e7cab51de5ba8),platform=Windows NT 6.3.9600 x86_64) (WARNING: The server did not provide …Run Code Online (Sandbox Code Playgroud)