Skip to content

Instantly share code, notes, and snippets.

@angelovstanton
Created August 20, 2020 09:40
Show Gist options
  • Save angelovstanton/35af8a1ced790fc228e1af54dbba57e0 to your computer and use it in GitHub Desktop.
Save angelovstanton/35af8a1ced790fc228e1af54dbba57e0 to your computer and use it in GitHub Desktop.
@Test
public void takeFullScreenshot_test() throws Exception {
driver.navigate().to("http://automatetheplanet.com");
takeFullScreenshot("testImage");
}
@Test
public void takeElementScreenshot_test() throws Exception {
driver.navigate().to("http://automatetheplanet.com");
var element = wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("/html/body/div[1]/header/div/div[2]/div/div[2]/nav")));
takeScreenshotOfElement(element, "testElementImage");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment