The type org.openqa.selenium.chrome.ChromeDriver i

2019-09-20 14:33发布

问题:

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:

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.

回答1:

To avoid such error, You must change java compiler to early version 1.7 or 1.7 from configuring build path.enter image description here



回答2:

Download selenium Client and Webdriver jar form the below link:

https://www.seleniumhq.org/download/



回答3:

try this link to understand some setting to work with Java 10 before you use it. Hope this helps : https://www.youtube.com/watch?v=_JNeiGbAgL4&list=PL9ooVrP1hQOFP9H8Y15DVGCA6GavhgJ8a&index=2



回答4:

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.



回答5:

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