Sam Sam - 1 month ago 13
HTML Question

Is there a way to extract html comment(s) using Selenium / WebDriver?

The web app I need to test is made up of frames and has an HTML comment (

<!-- some text -->
) at the end which will be present when the page finishes loading.

Answer

You could get the pagesource and check if the comment is there

 _driver.Navigate().GoToUrl("http://mysite.com");
  var source = _driver.PageSource;
  //check the source of the page to see if the commet is there.
Comments