Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
@Test
public void frames() {
driver.navigate().to("https://the-internet.herokuapp.com/nested_frames");
WebElement defaultFrame = driver.findElement(By.name("frame-top"));
driver.switchTo().frame(1);
Assert.assertEquals("BOTTOM", driver.findElement(By.tagName("body")).getText());
driver.switchTo().parentFrame();
driver.switchTo().frame("frame-top");
driver.switchTo().frame("frame-left");
Assert.assertEquals("LEFT", driver.findElement(By.tagName("body")).getText());
driver.switchTo().defaultContent();
Assert.assertTrue(driver.findElement(By.name("frame-top")).getSize().height>0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment