简体   繁体   中英

Firefox starts but url is cannot open using selenium

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);  

  }

  }

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM