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

时光毁灭记忆、已成空白 提交于 2019-11-27 15:11:48

This error happens when you use Eclipse as IDE and try to run code that doesn't even compile. Check your Problems view in Eclipse, and fix the compilation errors before executing the application.

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.

I had the same problem but then i came to know that i was missing a jar to add, this jar is not inside the lib folder you can find it immediately outside the lib folder: client-combined-3.0.1-nodeps.jar

I had the problem of WebDriver cannot be resolved to a type FirefoxDriver cannot be resolved to a type.I was using Selenium -java 3.0.1 jars.Also the jars client-combined-3.0.1-nodeps are required to to added .hence problem solved.

WebDriver3.0 will support the latest firefox also. but you have to set the properties for that

download "geckodriver.exe" file and you can try this.

System.setProperty("webdriver.firefox.marionette",
            "E:\\SeleniumAutomation\\geckodriver-v0.9.0-win64\\geckodriver.exe");
    driver = new FirefoxDriver();
    driver.get("http://stackoverflow.com/");
Aditi

You just need to import two links:

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;

or you can follow that tutorial:

https://www.youtube.com/watch?v=7yYDOja8n_k

It works for me.

Please follow the below steps:

  1. right-click on project--> goto build path--> configure build path
  2. Click on Classpath node which is just below the Modulepath node.
  3. click "Add external jars"--> add selenium jar files from your local machine-->
  4. Click Apply and Close button.
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!