public void Can_fluently_select_inner_html_table_class() { var stringHtmlLoader = new StringHtmlLoader(HTML_WITH_TABLE); var htmlDocument = new HtmlDocument(); htmlDocument.LoadHtml(HTML_WITH_TABLE); var currentNodes = new FluentHtmlSelector(stringHtmlLoader) .MoveToNode("td.cnt_txt") .MoveToNode("a") .Build(); Assert.That(currentNodes.Count(), Is.GreaterThan(0)); }
public void Can_add_history() { var stringHtmlLoader = new StringHtmlLoader(HTML_WITH_LINK); IHtmlSelector htmlSelector = new FluentHtmlSelector(stringHtmlLoader); Assert.That(htmlSelector.CurrentNode().OuterHtml, Is.EqualTo(HTML_WITH_LINK)); htmlSelector.ClickLink("a[id='googleLink']"); Assert.That(htmlSelector.CurrentNode().OuterHtml, Is.Not.EqualTo(HTML_WITH_LINK)); htmlSelector.GoBack(); Assert.That(htmlSelector.CurrentNode().OuterHtml, Is.EqualTo(HTML_WITH_LINK)); htmlSelector.ClickLink("a[id='googleLink']"); Assert.That(htmlSelector.CurrentNode().OuterHtml, Is.Not.EqualTo(HTML_WITH_LINK)); htmlSelector.GoBack(); Assert.That(htmlSelector.CurrentNode().OuterHtml, Is.EqualTo(HTML_WITH_LINK)); }
public void Can_fluently_select_links() { var stringHtmlLoader = new StringHtmlLoader(HTML_WITH_LINK); IHtmlSelector htmlSelector = new FluentHtmlSelector(stringHtmlLoader) .ClickLink("a[id='googleLink']"); Assert.That(htmlSelector, Is.Not.Null); string title = htmlSelector.MoveToNode("title").CurrentNode().InnerText; Assert.That(title, Is.EqualTo("Google")); }