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

- 183,867
- 41
- 278
- 352

- 63
- 1
- 1
- 5
-
What steps did you take to add that JAR to your project? Do you have it added to your build path? – vs97 Feb 26 '19 at 01:22
-
1I added the jars by right clicking name of the project-build path-configure build path and then i added all external jars under the modulepath. I also tried to add all jars under classpath but that also didn't work. I just edited my question with the screenshot of the build path too. – reyrro Feb 26 '19 at 02:22
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

- 183,867
- 41
- 278
- 352
-
2Thanks a lot. I got your point. i fixed all my import errors by using selenium-standalone-server-v2.7 and jar files v 3.52. Thankyou! It would be great if you can help me in another query, I downloaded eclipse neon 3 initially, but i got log error while launching. I tried other eclipse versions too like oxygen, mars etc, nothing worked. Can you help me out. Thankyou – reyrro Feb 26 '19 at 09:06
-
@reyrro Your other query seems to be all together a new question. Can you raise a new question as per your new requirement? Stack Overflow contributors will be happy to help you out. – undetected Selenium Feb 26 '19 at 09:13
-
1