51Testing软件测试论坛

标题: 构建Selenium环境出错:org.openqa.selenium.os.OsProcess checkForError [打印本页]

作者: 测试积点老人    时间: 2021-11-2 11:36
标题: 构建Selenium环境出错:org.openqa.selenium.os.OsProcess checkForError
Selenium依赖:
  1.   <!-- https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java -->
  2.         <dependency>
  3.             <groupId>org.seleniumhq.selenium</groupId>
  4.             <artifactId>selenium-java</artifactId>
  5.             <version>3.141.59</version>
  6.         </dependency>
复制代码
Edge驱动下载:
https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/
[color=rgba(0, 0, 0, 0.75)]我下载的是和我的浏览器版本相同的。
[color=rgba(0, 0, 0, 0.75)]代码:
  1. public class test
  2. {
  3.     public static void main(String[] args)
  4.     {
  5.             System.setProperty("webdriver.edge.driver", "D:\\JAVA代码\\eage驱动\\新建文件夹\\msedgedriver.exe");
  6.             EdgeDriver driver = new EdgeDriver();
  7.     }
  8. }
复制代码
错误信息:
  1. 错误信息:
  2. 11月 01, 2021 8:49:06 下午 org.openqa.selenium.os.OsProcess checkForError
  3. 严重: org.apache.commons.exec.ExecuteException: Execution failed (Exit value: -559038737. Caused by java.io.IOException: Cannot run program "D:\JAVA代码\eage驱动\新建文件夹\msedgedriver.exe" (in directory "."): CreateProcess error=216, 该版本的 %1 与你运行的 Windows 版本不兼容。请查看计算机的系统信息,然后联系软件发布者。)
  4. Exception in thread "main" org.openqa.selenium.WebDriverException: Timed out waiting for driver server to start.
  5. Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'
  6. System info: host: 'HUANGWEIMIN', ip: '192.168.27.59', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '16.0.2'
  7. Driver info: driver.version: EdgeDriver
  8.     at org.openqa.selenium.remote.service.DriverService.waitUntilAvailable(DriverService.java:202)
  9.     at org.openqa.selenium.remote.service.DriverService.start(DriverService.java:188)
  10.     at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:79)
  11.     at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:552)
  12.     at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:213)
  13.     at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:131)
  14.     at org.openqa.selenium.edge.EdgeDriver.<init>(EdgeDriver.java:141)
  15.     at org.openqa.selenium.edge.EdgeDriver.<init>(EdgeDriver.java:96)
  16.     at test.main(foure.java:294)
  17. Caused by: org.openqa.selenium.net.UrlChecker$TimeoutException: Timed out waiting for [http://localhost:3318/status] to be available after 20013 ms
  18.     at org.openqa.selenium.net.UrlChecker.waitUntilAvailable(UrlChecker.java:100)
  19.     at org.openqa.selenium.remote.service.DriverService.waitUntilAvailable(DriverService.java:197)
  20.     ... 8 more
  21. Caused by: java.util.concurrent.TimeoutException
  22.     at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:204)
  23.     at com.google.common.util.concurrent.SimpleTimeLimiter.callWithTimeout(SimpleTimeLimiter.java:156)
  24.     at org.openqa.selenium.net.UrlChecker.waitUntilAvailable(UrlChecker.java:75)
  25.     ... 9 more
  26. 进程已结束,退出代码为 1
复制代码



作者: qqq911    时间: 2021-11-3 10:38
和你操作系统不兼容




欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/) Powered by Discuz! X3.2