FirefoxDriver cannot be resolved to a type | Selenium Forum
M
Murali Katragadda Posted on 26/02/2019

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

 

I am receiving the above mentioned error when I run the code..

public class Selenium_Basics {

public static void main(String[] args) {
System.setProperty("webdriver.gecko.driver", "C:\\Drivers\\geckodriver.exe");
FirefoxDriver driver = new FirefoxDriver();

}

}


A
Ashish Thakur Replied on 26/02/2019

Please add the selenium jars in the project and import the firefox driver .

Please refer video 12 in selenium training modules


M
Murali Katragadda Replied on 26/02/2019

I have already added the jars in the project and imported the firefox driver and saved the firefox driver in my C drive..I have attached a screeshot that shows all jars. Could you please let me know if I am missing anything?


A
Ashish Thakur Replied on 28/02/2019

You have not imported the class on the first line

import org.openqa.selenium.firefox.FirefoxDriver;


A
Ashish Thakur Replied on 01/03/2019

Is it fine now


U
Upinder Kaur Replied on 06/01/2021

HI Ashish, I am also getting the same error however I have imported the jars as well as the firefox driver on top. Can you please suggest?

 

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

public class Driver {

public static void main(String[] args) {
// TODO Auto-generated method stub

System.setProperty("webdriver.gecko.driver", "C:\\Web Drivers\\geckodriver.exe");
FirefoxDriver fd = new FirefoxDriver();
fd.get("http://devlapp06/OnlineBanking/MyFinancial/Admin/");
}

}


U
Upinder Kaur Replied on 06/01/2021

Please ignore the above comment, its fine now. I needed to add the jars under class path, not module path.