WebDriver cannot be resolved to a type FirefoxDriver cannot be resolved to a type

Juvelle Mendes picture Juvelle Mendes · Jul 31, 2015 · Viewed 81.2k times · Source

I found a similar error as mine on stackoverflow and added selenium webdriver jar files to the project using the below method :

right click on project--> goto build path--> configure build path--> click on "Add external jars"--> add selenium jar files from your local machine--> click ok--> now mouseover on WebDriver in your code--> click "import webdriver"--now run your code-->you will get rid of the exception.

However, I am still getting an error. Here's the error :

Exception in thread "main" java.lang.Error: Unresolved compilation problems: WebDriver cannot be resolved to a type FirefoxDriver cannot be resolved to a type

Answer

ram picture ram · May 13, 2016

even i got the the same error but then i realised that i missed 2 additional JAR files from Selenium 2.53.0.

selenium-java-2.53.0-srcs.jar selenium-java-2.53.0.jar

these are not in the sub library " libs" in selenium 2.53.0 but listed separately in the same folder.