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

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

Leave a Comment