I have a Telerik editor on a page with some text in it. I have a test that needs to be able to select a particular word but haven't found a way to to that with the Telerik.WebAii.Controls.
Anyone know how to do this?
2 Answers, 1 is accepted
0
Missing User
answered on 20 Oct 2009, 08:35 PM
Hi John,
So based on this RadEditor demo page, you can get the string from the body tag like this:
Browser b = ActiveBrowser.Frames.ById("RadEditor1_contentIframe");
HtmlControl c = b.Find.ByTagIndex<HtmlControl>("body",0);
String s = c.BaseElement.GetPreservedInnerText(true);
and parse out the word you wanted.
But were you looking to highlight a particular word? Here you would need write a Desktop.Mouse.DragDrop operation and calculate the coordinates to start and stop on screen to highlight the word.
Highlighting this way may seem somewhat tedious to write, but please keep in mind that WebUI Test Studio would be able to do this and more for you automatically.