Wednesday, June 4, 2014

How to double click on a webelement and how to get the number of frames in a web page.

Ques1- How to find how many iframes are present in one page?
Ans-  List<WebElement> frames = driver.findElements(By.tagName("iframe"));
int numOfFrame = frames.size();

Ques2- How to handle double click on webdriver?
Ans-  use Actions class.
Actions act = new Actions(driver);
act.moveToElement(webElement).doubleClick().perform();

No comments:

Post a Comment