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

前端 未结 4 2195
梦谈多话
梦谈多话 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:14

    Through chaining methods together, once you switchTo().defaultContent, you can create temporary lists of available frames through findElements() by tagName and go to that specific frames' index...

    For example

    driver.switchTo()defaultContent();
    driver.switchTo().frame(driver.findElement(By.tagName("frameset")).findElements(By.tagName("frame")).get(2));
    

提交回复
热议问题