Saturday, October 18, 2008
by
Telerik Automated Testing Tools
|
Are you curious how to deal with the complicated rendering of RadControls and WatiN? If so, I will shed some light on this.
Here is an example how to print the text of the specific node of RadTreeView and how to expand it:
| [STAThread] |
| static void Main(string[] args) |
| { |
| IE ie = new IE("http://demos.telerik.com/aspnet/prometheus/TreeView/Examples/Programming/DataBinding/DefaultCS.aspx"); |
| Element ulElement = ie.Element("UL", Find.ByClass("rtUL rtLines")); |
| Element firstLiElement = ulElement.DomContainer.Element("LI", Find.ByIndex(1)); |
|
| Span textSpanElement = (Span) firstLiElement.DomContainer.Div(Find.ByClass("rtTop")).DomContainer.Span(Find.ByClass("rtIn")); |
| Console.WriteLine(textSpanElement.Text); |
| Span plusSpanElement = (Span)textSpanElement.PreviousSibling; |
| plusSpanElement.Click(); |
|
| } |
|
Yet another example how to click on a ...