6

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

2
  • What steps did you take to add that JAR to your project? Do you have it added to your build path? Commented Feb 26, 2019 at 1:22
  • 1
    I 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. Commented Feb 26, 2019 at 2:22

1 Answer 1

4

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

Sign up to request clarification or add additional context in comments.

3 Comments

Thanks 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 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.
Yes sure.Thanks.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.