import java.util.Iterator;
import java.util.Set;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
public class Hdfc_ex {
public static void main(String[] args) {
System.setProperty("webdriver.chrome.driver"(System.getProperty("user.dir")+"\\chromedriver\\chromedriver.exe"));
WebDriver dr=new ChromeDriver();
dr.get("http://hdfcbank.com");
dr.findElement(By.id("loginsubmit")).click();
Set<String> allwindows = dr.getWindowHandles();
//System.out.println(allwindows.size());
Iterator<String> iter= allwindows.iterator();
String tabId=iter.next();
String mID=iter.next();
dr.switchTo().window(mID);
dr.findElement(By.xpath("html/body/div[1]/div/div/div[6]/a/img")).click();
}
}
import java.util.Set;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
public class Hdfc_ex {
public static void main(String[] args) {
System.setProperty("webdriver.chrome.driver"(System.getProperty("user.dir")+"\\chromedriver\\chromedriver.exe"));
WebDriver dr=new ChromeDriver();
dr.get("http://hdfcbank.com");
dr.findElement(By.id("loginsubmit")).click();
Set<String> allwindows = dr.getWindowHandles();
//System.out.println(allwindows.size());
Iterator<String> iter= allwindows.iterator();
String tabId=iter.next();
String mID=iter.next();
dr.switchTo().window(mID);
dr.findElement(By.xpath("html/body/div[1]/div/div/div[6]/a/img")).click();
}
}
No comments:
Post a Comment