LINQ-to-DOM

You can now access the DOM with LINQ:
foreach (var td in web.Dom.TableCells)
{
     Console.WriteLine(td.Text);
}
var tds = web.Dom.TableCells.Where(td => td.Class == "someClass");
var lastTd = web.Dom.Tables.First().TableCells.Last();
var textbox = web.Dom.Textboxes.First();
textbox.SendKeys("hello world");
Assert.AreEqual("hello world", textbox.Value);

Also supports the ForEach() function:
web.Dom.Checkboxes.ForEach(cb => cb.SelectCheckbox(true));

Last edited Feb 23, 2012 at 4:59 PM by anderslyman, version 1

Comments

No comments yet.