multiple framesets in a webpage

I have multiple framesets in a webpage with multiple frames in it.I have to navigate to a particular frame in a particular frameset and identify the element.

Any help would be appreciates

Add Comment
  • 1 Answer(s)

    Hi
    You can switch by frame/iframe id like: driver.switchTo().frame(frameId);
    Remember!
    You can switch only to child frame.
    Or if they don’t have ids, you can use their indexes like:
    List<WebElement> frames = driver.findElements(By.tagName(“iframe”));
    driver.switchTo().frame(frames.get(frameIndex));
    To get to “main parent” use
    driver.switchTo().defaultContent();

    Wait for your feedback.

    Reviewer Answered on July 13, 2015.
    Add Comment
  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.