Skip to content

Instantly share code, notes, and snippets.

@ultimate-qa2
Created February 28, 2021 18:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ultimate-qa2/b70ac72255053655c30b565e55944572 to your computer and use it in GitHub Desktop.
Save ultimate-qa2/b70ac72255053655c30b565e55944572 to your computer and use it in GitHub Desktop.
@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