Is there a way to verify a whole sentence in a text box, text area? On our recording, what happens is that when we verify the sentence it recognizes only each of the text as a text block control. Also that sentence can be a hyperlink and we hope to verify if its a hyperlink
Thanks.
7 Answers, 1 is accepted
Are you referring to a Silverlight RadRichTextBox, as demonstrated on this page? If so, this is a known issue. Each word is contained within a TextBlock as you mentioned.
Unfortunately we do not currently have a RadRichTextBox translator in Test Studio. In the meantime, the per elements approach is the only method we can offer. How important is it to you that you automate your RadRichTextBox? It is a very complex control. Without a translator it will require quite a bit of custom code to work with it at the level you are asking. It may not be worth the time invested and manually testing that portion of your application may be more productive in the long run.
This has previously been submitted as a feature request. You can track the PITS Issue here: Public URL.
Kind regards,
Anthony
the Telerik team
Yes, it is a richtextbox. We want to know that the richtextbox contains the selected value and is a hyperlink.
can you give us some custom code?
Thanks
RichTextBox's are difficult to work with. They are a "container" type of object that contains a collection of Paragraph objects and each Paragraph object can contain a number of other objects as documented here in a free form (i.e. there is no rule about what goes where). The first step is to see exactly the full contents of what has been placed in your RichTextBox so we can understand what/how to parse that content and verify it has what you're looking for. Start with this type of code in a coded step. Once we see the full contents contained in your RichTextBox we can determine how to parse and verify it.
[CodedStep("Get RTB Text")]
public void GetRTBtext()
{
// Retrieve the contents of the RichTextBox.
string rtbContents = (string)Pages.SilverlightAppTesting.SilverlightApp.RichTextBox1Richtextbox.GetProperty(new AutomationProperty("Xaml", typeof(string)));
Log.WriteLine(rtbContents);
}
Cody
the Telerik team
I've encountered this error. When running the test
InnerException:
ArtOfTest.WebAii.Silverlight.ExecuteSilverlightCommandException: [Silverlight Extension Error] Details: ArtOfTest.WebAii.Silverlight.NoSuchPropertyException: Property 'Xaml' does not exist on the element
at Telerik.TestingFramework.XamlExtension.ClientServices.GetRealProperty(AutomationReference reference, AutomationProperty property)
at Telerik.TestingFramework.XamlExtension.ClientProcessor.ProcessCommand(String command)
at ArtOfTest.WebAii.Silverlight.SilverlightProxy.ExecuteSLCommand(SilverlightCommand cmd)
at ArtOfTest.WebAii.Silverlight.SilverlightProxy.GetProperty(AutomationProperty property, IAutomationPeer peer)
at ArtOfTest.WebAii.Silverlight.AutomationObject`1.GetProperty(AutomationProperty property)
I've added the richtextbox control on my elements.
Thanks!
I see. So obviously something is not right. I do know a standard Silverlight RichTextBox has the Xaml properly and the best/easiest way to figure out the problem is to look at this problem on your computer via GoToMeeting. Let me know what time zone you are in and your availability and I'll setup the meeting. I'm in Austin, TX which is Central Time (GMT -6).
Greetings,Cody
the Telerik team
We'll try to ask our developers on how they implemented the control in our application. Also, I'm in Manila, Philippines which is GMT +8.
Thanks.
Let me know the answer(s) from your developers and we'll go from there. It would help me tremendously if you could have them create a small sample Silverlight application that you can send me which replicates the problem that I can study and assist with.
Regards,Cody
the Telerik team