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

后端 未结 7 1756
一个人的身影
一个人的身影 2020-12-01 21:51

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

相关标签:
7条回答
  • 2020-12-01 22:22

    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.
    0 讨论(0)
  • 2020-12-01 22:23

    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

    0 讨论(0)
  • 2020-12-01 22:25

    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.

    0 讨论(0)
  • 2020-12-01 22:26

    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/");
    
    0 讨论(0)
  • 2020-12-01 22:28

    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.

    0 讨论(0)
  • 2020-12-01 22:37

    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.

    0 讨论(0)
提交回复
热议问题