How to access elements in a frame which is inside a frame ?

Suppose I have 4 frames on a page. The 2nd frame has 4 frames inside it. How to access the inner frames?

Default Asked on November 16, 2017 in Selenium WebDriver.
Add Comment
  • 1 Answer(s)

    Overall, you need to use enhancing for loop two times. First use the For each and enter into 2nd frame now again use enhancing for loop to iterate all the frames within the 2nd frame and then use any of 3 ways (select by Index, select by value or select by

    web element) to identify the exact frame which you want to access and then use driver.switchto().frame(select by *) move into the inner frame. Now you entered into the frame which you want to access and now get the elements to perform the action within that frame.

    If you want to come out of the frame use parentFrame() or defaultContent();

    Hope this helps!

    Default Answered on November 16, 2017.
    Add Comment
  • Your Answer

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