In my previous post I've explained that how we can call the web browser to the java script. So now lets see how we can simply cal a URL / web page using java web driver. Its simple.
WebDriver A = new FirefoxDriver();
A .get("http://www.google.lk ");
Like in the previous post you have to create a object from the "webDriver" class and call the URL with the get() method. you can pass any URL to get method, Or you can pass the variable name which is assigned to URL as well.
WebDriver A= new FirefoxDriver();
String URL = "http://www.google.lk";
A.get(URL);
In a same test script you can call all 03 browses as well.
WebDriver A= new FirefoxDriver();
String URL = "http://www.google.lk";
A.get(URL);
System.setProperty("webdriver.chrome.driver","D://Nayana//ActivePresenter//drivers//drivers//chromedriver.exe");
WebDriver B = new ChromeDriver();
B.get(URL);
System.setProperty("webdriver.ie.driver","D://Nayana//ActivePresenter//drivers//drivers//IEDriverServer.exe");
WebDriver C = new InternetExplorerDriver();
C.get(URL);
WebDriver A = new FirefoxDriver();
A .get("http://www.google.lk ");
Like in the previous post you have to create a object from the "webDriver" class and call the URL with the get() method. you can pass any URL to get method, Or you can pass the variable name which is assigned to URL as well.
WebDriver A= new FirefoxDriver();
String URL = "http://www.google.lk";
A.get(URL);
In a same test script you can call all 03 browses as well.
WebDriver A= new FirefoxDriver();
String URL = "http://www.google.lk";
A.get(URL);
System.setProperty("webdriver.chrome.driver","D://Nayana//ActivePresenter//drivers//drivers//chromedriver.exe");
WebDriver B = new ChromeDriver();
B.get(URL);
System.setProperty("webdriver.ie.driver","D://Nayana//ActivePresenter//drivers//drivers//IEDriverServer.exe");
WebDriver C = new InternetExplorerDriver();
C.get(URL);
No comments:
Post a Comment