The type org.openqa.selenium.chrome.ChromeDriver is not accessible

Viewed 36516

I am getting the error like "The type org.openqa.selenium.chrome.ChromeDriver is not accessible" for almost all the classes I am using in Selenium.

It was working fine till I was using Java 8 but when I upgraded to Java 10 I am getting errors like this.

See the screenshot of the project below:

enter image description here

Edit 1:

Selenium-server jar file also contains all the webdriver code as well. See the below image. It has the ChromeDriver class in the same package which I have imported in the above class. The same combination is working fine If I am using either Java 8 (again see the below screenshot)or an older version of eclipse say neon. enter image description here

enter image description here

12 Answers

To avoid such error, You should change java compiler to early version 1.7 or 1.7 from configuring build path.

enter image description here

I too got the same error, There would be a file named module-info.java in src folder. Just comment on all lines in it and the error is gone. I am not sure how, but it works.

I faced same issue today with eclipse photon. In the process of fixing the issue, i removed selenium standalone jar and issue was resolved. I could see you added selenium standalone jar to your project. Remove that and try again. Hope that works.

Delete the latest version of selenium.server.standalone.jar and instal and add to build path any previous version. It worked for me

I had added the jars file in modulepath. Make sure you are adding them in classpath while choosing to add external jars.

Years later I got this gem with selenium-java-3.141.59 turns out they've done some jar shuffling and I needed to add "requires okio;" to module-info.java

I got the same problem too. Just create a new project without creating a module package. Now it runs without errors.

Remove module-info.java from src folder.

i am facing the same problem ... org.openqa.selenium is not accessible....

i tried to delete module.java.... the problem is still alive.

so i am trying to correct this problem...

Step 1: go to the project right click and select properties step 2: There select Add Library -- > add JRE System Library -- > Execution Environment ---> select Latest version --> Apply

the problem resolved automatically

Related