Selenium : Display frame names when frame id is not present
List<WebElement> ele = driver.findElements(By.tagName("frame"));
System.out.println("Number of frames in a page :" + ele.size());
for(WebElement el : ele){
//Returns the Id of a frame.
System.out.println("Frame Id :" + el.getAttribute("id"));
//Returns the Name of a frame.
System.out.println("Frame name :" + el.getAttribute("name"));
}
System.out.println("Number of frames in a page :" + ele.size());
for(WebElement el : ele){
//Returns the Id of a frame.
System.out.println("Frame Id :" + el.getAttribute("id"));
//Returns the Name of a frame.
System.out.println("Frame name :" + el.getAttribute("name"));
}
No comments:
Post a Comment