Skip to content

Instantly share code, notes, and snippets.

@angelovstanton
Last active February 15, 2016 07:08
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 angelovstanton/46b53b6bff4edffe7ac8 to your computer and use it in GitHub Desktop.
Save angelovstanton/46b53b6bff4edffe7ac8 to your computer and use it in GitHub Desktop.
[TestMethod]
public void GetHtmlSourceOfWebElement()
{
this.driver.Navigate().GoToUrl(@"http://automatetheplanet.com");
this.WaitUntilLoaded();
var element =
this.driver.FindElement(By.XPath("//*[@id='tve_editor']/div[2]/div[3]/div/div"));
string sourceHtml = element.GetAttribute("innerHTML");
Debug.WriteLine(sourceHtml);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment