1

after run this program the Mozilla are automatically open and I login to proxy authentication but the url is not settled anybody can help thanks

 public class SimpleSelenium {
   WebDriver driver = null;
   String url = "http://www.google.com";



public static void main(String args[]) {


    SimpleSelenium ss = new SimpleSelenium();
    ss.openBrowser();
    ss.getPage();
    ss.quitPage();
}

private void openBrowser() {

    System.setProperty("webdriver.gecko.driver", "C:/geckodriver.exe");
    driver = new FirefoxDriver();


}

private void quitPage() {
    driver.quit();

}

private void getPage() {
    driver.get(url);  

  }

  }
Mr.Aw
  • 216
  • 3
  • 16

1 Answers1

0

You are using wrong method. It explained here Difference between webdriver.get() and webdriver.navigate()

Try driver.get("http://google.co.in");

Symph
  • 51
  • 8
  • I copied your new, edited code and it works just fine. The only thing I changed was .exe path. I'm using Maven and there is resources folder `System.setProperty("webdriver.gecko.driver", "src\\main\\resources\\geckodriver.exe");`. Maybe it will work? – Symph Sep 20 '17 at 07:49
  • what is your version of selenium jar and Mozilla? – Mr.Aw Sep 20 '17 at 07:58
  • Firefox 55.0.3. Selenium and firefox driver are at 3.4.0 – Symph Sep 20 '17 at 08:03