我需要测试的 Web 应用程序由框架组成,末尾有一个 HTML 注释 ( <!-- some text -->
),当页面完成加载时它会出现。
最佳答案
您可以获取页面源并检查评论是否存在
_driver.Navigate().GoToUrl("http://mysite.com");
var source = _driver.PageSource;
//check the source of the page to see if the commet is there.
关于html - 有没有办法使用 Selenium/WebDriver 提取 html 评论?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8416788/