[英]Exception in thread “main” org.openqa.selenium.WebDriverException: chrome not reachable
I am trying to launch Chrome(Version 58.0.3029.110 (64-bit)) using selenium (2.53.1) with pom as 我正在尝试使用硒(2.53.1)和pom启动Chrome(版本58.0.3029.110(64位))
<dependency> <groupId>org.seleniumhq.selenium</groupId> <artifactId>selenium-server</artifactId> <version>2.53.1</version> <exclusions> <exclusion> <artifactId>snakeyaml</artifactId> <groupId>org.yaml</groupId> </exclusion> </exclusions> </dependency>`
CODE :: 代码::
System.setProperty("webdriver.chrome.driver", System.getProperty("user.dir") + "\\lib\\chromedriver.exe");
System.out.println(System.getProperty("webdriver.chrome.driver"));
DesiredCapabilities desiredCapabilities = DesiredCapabilities.chrome();
ChromeOptions options = new ChromeOptions();
options.addArguments("disable-infobars");
desiredCapabilities.setCapability(ChromeOptions.CAPABILITY, options);
WebDriver driver = new ChromeDriver();
driver.get("http://www.google.com");
I am getting the following exception in my eclipse console 我在Eclipse控制台中收到以下异常
D:\\eclipse\\QA_Code_Git_Gerrit\\TA-PAY\\api-automation\\lib\\chromedriver.exe Starting ChromeDriver 2.29.461591 (62ebf098771772160f391d75e589dc567915b233) on port 38042 Only local connections are allowed. D:\\ eclipse \\ QA_Code_Git_Gerrit \\ TA-PAY \\ api-automation \\ lib \\ chromedriver.exe在端口38042上启动ChromeDriver 2.29.461591(62ebf098771772160f391d75e589dc567915b233)仅允许本地连接。 Exception in thread "main" org.openqa.selenium.WebDriverException: chrome not reachable (Driver info: chromedriver=2.29.461591 (62ebf098771772160f391d75e589dc567915b233),platform=Windows NT 6.1.7601 SP1 x86_64) (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 62.38 seconds Build info: version: '2.53.1', revision: 'a36b8b1cd5757287168e54b817830adce9b0158d', time: '2016-06-30 19:26:09' 线程“主” org.openqa.selenium.WebDriverException中的异常:无法访问chrome(驱动程序信息:chromedriver = 2.29.461591(62ebf098771772160f391d75e589dc567915b233),platform = Windows NT 6.1.7601 SP1 x86_64)(警告:服务器未提供任何堆栈跟踪信息)命令持续时间或超时:62.38秒构建信息:版本:'2.53.1',修订:'a36b8b1cd5757287168e54b817830adce9b0158d',时间:'2016-06-30 19:26:09'
Please help me with this. 请帮我解决一下这个。 I dont know what is the issue. 我不知道这是什么问题。
Not sure if Selenium 2.53 would work with the latest ChromeDriver. 不知道Selenium 2.53是否可以与最新的ChromeDriver一起使用。 It would be good if you can try with the latest version of Selenium (v 3.4) 如果可以尝试使用最新版本的Selenium(v 3.4),那就更好了。
Give this 给这个
System.setProperty("webdriver.chrome.driver", System.getProperty("user.dir") + "\\lib\\chromedriver.exe");
System.out.println(System.getProperty("webdriver.chrome.driver"));
DesiredCapabilities desiredCapabilities = DesiredCapabilities.chrome();
ChromeOptions options = new ChromeOptions();
options.addArguments("disable-infobars");
desiredCapabilities.setCapability(ChromeOptions.CAPABILITY, options);
WebDriver driver = new ChromeDriver(desiredCapabilities);
driver.get("http://www.google.com");
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.