Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to import org.openqa.selenium.WebDriver using Selenium and Java 11

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

enter image description here

enter image description here

like image 586
reyrro Avatar asked Oct 16 '22 06:10

reyrro


1 Answers

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.

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.

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 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.


Solution

The strategic solution will be to install the latest version of JDK 8u212 and execute the @Tests

like image 173
undetected Selenium Avatar answered Oct 29 '22 16:10

undetected Selenium