Monday, March 23, 2015

How to play with WebDriver API and Open URL of the application in Selenium ?

First we need to set internet explorer exe path and initiate Webdriver using below code.

public class BrowserStart {
  
    public static WebDriver driver;
  
    public static void loadbrowser () throws InterruptedException{
      
        //Set Internetexplorer exe path..
      
        File file = new File(System.getProperty("user.dir") + "/libs/IEDriverServer.exe");
        System.setProperty("webdriver.ie.driver", file.getAbsolutePath());
      
         driver = new InternetExplorerDriver();
        driver.get("http://www.google.com");

      }
}

No comments:

Post a Comment