Created
August 20, 2020 09:44
-
-
Save angelovstanton/e7ad9fac1e30b6ee140e4bf2f7f222f3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Test | |
public void getHtmlSourceOfWebElement() { | |
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"))); | |
String sourceHtml = element.getAttribute("innerHTML"); | |
System.out.println(sourceHtml); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment