Madhu Ragi
Madhu Ragi

Reputation: 41

How do i fix the issue with dependencies of firefox and selenium

Code used:

package cucmberTest;
import java.util.concurrent.TimeUnit;    

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

public class SeleniumTest {

    System.setProperty("webdriver.gecko.driver", "C:\\java\\geckoDriver\\geckodriver-v0.16.1-win64\\geckodriver.exe");
    private static WebDriver driver = null;


    public static void main(String[] args) {
        System.setProperty("webdriver.gecko.driver", "C:\\java\\geckoDriver\\geckodriver-v0.16.1-win64\\geckodriver.exe");

        // TODO Auto-generated method stub
          driver = new FirefoxDriver();

        //Put a Implicit wait, this means that any search for elements on the page could take the time the implicit wait is set for before throwing exception

        driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);

        //Launch the Onlinebank

        //driver.get("https://tst-2015.moneyou.nl/hypotheek/berekenen/bereken-je-maximale-hypotheek#");
        driver.get("https://www.google.com");

        driver.quit();

    }

}

Error:

Exception in thread "main" java.lang.Error: Unresolved compilation problem: at cucmberTest.SeleniumTest.main(SeleniumTest.java:15)

Upvotes: 0

Views: 97

Answers (1)

mohamed faisal
mohamed faisal

Reputation: 177

you simply need to remove the (System.setProperty) before the main method

please try below code

package cucmberTest;
import java.util.concurrent.TimeUnit;    
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;

public class SeleniumTest {

     private static WebDriver driver = null;

            public static void main(String[] args) {
                System.setProperty("webdriver.gecko.driver", "C:\\java\\geckoDriver\\geckodriver-v0.16.1-win64\\geckodriver.exe");

                // TODO Auto-generated method stub
                  driver = new FirefoxDriver();

                //Put a Implicit wait, this means that any search for elements on the page could take the time the implicit wait is set for before throwing exception

                driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);

                //Launch the Onlinebank

                //driver.get("https://tst-2015.moneyou.nl/hypotheek/berekenen/bereken-je-maximale-hypotheek#");
                driver.get("https://www.google.com");

                driver.quit();

            }
 }

Upvotes: 1

Related Questions