无法使用Selenium和Java 11导入org.openqa.selenium.WebDriver [英] Unable to import org.openqa.selenium.WebDriver using Selenium and Java 11
问题描述
我是Selenium Webdriver和Java编程的新手.尝试解决eclipse 2018-12中的错误无法解决导入org.openqa.selenium.WebDriver",我使用Java 11,Selenium独立服务器3.141.59.请帮助.我无法导入jar文件,下面是屏幕截图
I'm new to selenium webdriver and java programming. Trying to resolve the error in eclipse 2018-12 "The import org.openqa.selenium.WebDriver cannot be resolved" Im using java 11, selenium standalone server 3.141.59 . Kindly help. I'm unable to import jar files Below is the screenshot
推荐答案
根据不能编译具有selenium-java作为依赖关系的Java9模块 似乎由于 split软件包, Selenium 软件包无法使用 Java 9 进行编译>直到 2018年5月15日 Selenium尚未与Java 9完全兼容.
As per Can't compile Java9 module with selenium-java as dependency it seems the Selenium packages can't be compiled with Java 9 due to split packages and till May 15, 2018 Selenium wasn't fully compatible with Java 9.
但是按照评论 @ Jarob22所述,硒有效使用 Java 10 很好. Java 9 已经很流行,如果10可以正常工作,添加额外的东西尝试并支持它就没有多大意义了.
But as per this comment @Jarob22 mentioned, Selenium works just fine using Java 10. Java 9 is already eol and there's not much point adding extra stuff to try and support just it if 10 works.
但是随着 e57914a 西蒙向我们介绍了基本JPMS支持.有了此可用性,(mhomnag/selenium-java10-reproducer @ bc63889)现在可以实际构建,但您可能必须删除WebDriverWaiter并立即使用睡眠.
But with the landing of e57914a Simon introduced us with basic JPMS support. With this availability (mhomnag/selenium-java10-reproducer@bc63889) now actually builds but you may have to Remove the WebDriverWaiter and just use a sleep for now.
在使用 java.version:'11 .0.1'时, selenium-server-standalone-3.141.59.jar 仍与不兼容Java 11 .但是,一旦 Java 11 发行并且得到 Buck 支持,该工具链将被重新设置为支持 Java 11 .
As you are using java.version: '11.0.1', selenium-server-standalone-3.141.59.jar is still not compatible with Java 11. But once Java 11 ships and Buck supports it the toolchain witll be rejiged to support Java 11.
战略解决方案是安装最新版本的 JDK 8u212 并执行 @Tests
The strategic solution will be to install the latest version of JDK 8u212 and execute the @Tests
这篇关于无法使用Selenium和Java 11导入org.openqa.selenium.WebDriver的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!