How to find a specific element, or a list of elements by using their TagName using Watin?
+2
A:
For example, to find the first <h1> on a page, use:
ie.Element("h1", Find.ByIndex(0))
Lars Thorup
2009-01-04 12:35:23
and how to find last? :)
Arnis L.
2010-01-11 11:02:51
+1
A:
As of WatiN 2.0 beta 1 this has changed to:
ie.ElementWithTag("h1", constraint);
Jeroen van Menen
2009-03-31 08:37:44
Could you expand this example to show what is in the constraint object?
Andrew M
2010-08-25 08:57:09
A:
this is what worked for me:
var element = ie.Element(x => x.Text == "[innerText]" && x.TagName == "[tagname]");
mahmud khaled
2010-09-10 16:00:11