qq_35626770
qq_35626770
2020-02-13 15:18

selenium使用时的chrome driver无法驱动chrome浏览器

  • java
  • selenium
  • chrome

初次使用java+selenium

System.setProperty("webdriver.chrome.driver", "C:\\workspace\\software\\chromedriver\\chromedriver_win32 79\\chromedriver.exe");
WebDriver driver = new ChromeDriver();

编译运行后出现报错:

Exception in thread "main" org.openqa.selenium.WebDriverException: Timed out waiting for driver server to start.
Build info: version: '3.9.0', revision: '698b3178f0', time: '2018-02-05T14:56:13.134Z'
System info: host: 'DESKTOP-S88636J', ip: '192.168.31.91', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_191'
Driver info: driver.version: ChromeDriver
    at org.openqa.selenium.remote.service.DriverService.waitUntilAvailable(DriverService.java:192)
    at org.openqa.selenium.remote.service.DriverService.start(DriverService.java:178)
    at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:79)
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:601)
    at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:219)
    at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:142)
    at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:181)
    at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:168)
    at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:123)
    at Test1.main(Test1.java:22)

我的chrome浏览器版本为:80.0.3987.100 64bit
ChromeDriver : 80.0.3987.16
jdk :1.8.0_191

  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

1条回答