To work with Selenium 3.4.0 & Mozilla Firefox 53.x you need to download the latest geckodriver v0.16.1 from here. Save it in your machine & provide the absolute path of the geckodriver in your code.
Ensure that you have updated the pom.xml with the required dependency as follows:
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>3.4.0</version>
</dependency>
It is recommended to use the WebDriver interface rather than 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(); driver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS); driver.navigate().to("http://www.google.com");
Provide the following commands to flush out the previous dependencies, install the new dependencies & execute your test:
>mvn clean
>mvn install
>mvn test