简体   繁体   English

线程“主” org.openqa.selenium.WebDriverException中的异常:无法访问Chrome

[英]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. 我不知道这是什么问题。

Looks like you are using the wrong version of Chrome Driver. 看来您使用的是错误版本的Chrome驱动程序。

Since your Chrome browser version is 58.0.3029.110 , you have to use ChromeDriver 2.29 , which can be downloaded from here 由于您的Chrome browser版本为58.0.3029.110 ,因此您必须使用ChromeDriver 2.29 ,可从此处下载

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.

相关问题 org.openqa.selenium.WebDriverException: chrome 无法访问 - org.openqa.selenium.WebDriverException: chrome not reachable 线程“主”org.openqa.selenium.WebDriverException 中的异常:权限被拒绝 - Exception in thread “main” org.openqa.selenium.WebDriverException: permission denied 如何修复线程“主”org.openqa.selenium.WebDriverException 中的异常? - How to fix Exception in thread “main” org.openqa.selenium.WebDriverException? 线程“主” org.openqa.selenium.WebDriverException中的异常:未定义$ - Exception in thread “main” org.openqa.selenium.WebDriverException: $ is not defined 线程“ main”中的异常org.openqa.selenium.WebDriverException - Exception in thread “main” org.openqa.selenium.WebDriverException 线程“ main” org.openqa.selenium.WebDriverException中的异常:未知错误:Chrome无法启动:正常退出 - Exception in thread “main” org.openqa.selenium.WebDriverException: unknown error: Chrome failed to start: exited normally org.openqa.selenium.WebDriverException:无法使用Selenium和ChromeDriver访问Chrome - org.openqa.selenium.WebDriverException: chrome not reachable using Selenium and ChromeDriver Chrome 浏览器中的 Selenium 在线程“main”org.openqa.selenium.WebDriverException 中显示异常:等待驱动程序服务器启动超时 - Selenium in Chrome browser shows Exception in thread “main” org.openqa.selenium.WebDriverException: Timed out waiting for driver server to start 线程“主”org.openqa.selenium.WebDriverException 中的异常:未知错误:使用 Selenium Java 的意外命令响应 - Exception in thread "main" org.openqa.selenium.WebDriverException: unknown error: unexpected command response using Selenium Java 线程“主” org.openqa.selenium.WebDriverException中的异常:未知错误:无法聚焦元素 - Exception in thread “main” org.openqa.selenium.WebDriverException: unknown error: cannot focus element
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM