Explore Courses Blog Tutorials Interview Questions
0 votes
1 view
in DevOps and Agile by (19.7k points)

I am trying to use Selenium's latest version 3.4.0 in a maven project. I imported all Selenium's jars using below dependency:-






The problem is I am unable to resolve any dependency in my project in Eclipse for below code inside main method:-

public class FirefoxTest {

    public static void main(String[] args) {

        FirefoxOptions options = new FirefoxOptions();

        options.setBinary("C:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe"); //This is the location where you have installed Firefox on your machine

        FirefoxDriver driver = new FirefoxDriver(options);




What am I missing? Eclipse is unable to resolve FirefoxDriver type to any dependencies. Please help.

1 Answer

0 votes
by (62.9k points)

To work with selenium3.4.0 & Mozilla Firefox 53.x you would like to download the newest geckodriver v0.16.1 from here. Save it in your machine & provide the absolute path of the geckodriver in your code.

Ensure that you've got updated the pom.xml with the required dependency as follows:






It is suggested to use the WebDriver interface instead of to use the FirefoxDriver implementation.

Your code will look like:

 System.out.println("Welcome to Maven World");

    System.setProperty("webdriver.gecko.driver", "C:\\Utility\\BrowserDrivers\\geckodriver.exe");

    WebDriver driver = new FirefoxDriver();       



Provide the following commands to flush out the previous dependencies, install the new dependencies & execute your test:

>mvn clean

>mvn install

>mvn test

Welcome to Intellipaat Community. Get your technical queries answered by top developers!

28.4k questions

29.7k answers


94.7k users

Browse Categories