How to navigate a subframe inside a frameset using Selenium WebDriver?

前端 未结 4 2199
梦谈多话
梦谈多话 2020-11-28 14:41

I need to get the result from the table \"td\". But before I can do that I need to navigate a frame that contains it. The frame is one of the frameset elements that belongs

4条回答
  •  天涯浪人
    2020-11-28 15:20

    Find the index of main frame starting from zero then use

    driver.switchTo.frame(mainFrameindex);
    

    Then find the index of sub frame in the main frame

    driver.switchTo.frame(subFrameIndex);
    

    You cannot directly switch to a child frame without first switching to the parent frame. This is how it works.

提交回复
热议问题