This is a migrated thread and some comments may be shown as answers.

Verify a sentence not just text blocks

7 Answers 111 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Mark
Top achievements
Rank 1
Mark asked on 10 Aug 2011, 07:19 AM
Hi,

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

Sort by
0
Anthony
Telerik team
answered on 10 Aug 2011, 10:54 PM
Hi Mark,

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
Vote for Telerik Test Studio at the Annual Automation Honors Voting!
0
Mark
Top achievements
Rank 1
answered on 11 Aug 2011, 02:22 AM
Hi Anthony,

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
0
Cody
Telerik team
answered on 11 Aug 2011, 11:18 PM
Hi Mark,

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);
}

Best wishes,
Cody
the Telerik team
Vote for Telerik Test Studio at the Annual Automation Honors Voting!
0
Mariko
Top achievements
Rank 1
answered on 12 Aug 2011, 08:01 AM
Hi Cody,

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!
0
Cody
Telerik team
answered on 12 Aug 2011, 03:14 PM
Hello Mariko,

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
Vote for Telerik Test Studio at the Annual Automation Honors Voting!
0
Mariko
Top achievements
Rank 1
answered on 18 Aug 2011, 03:29 AM
Hi Cody,

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.
0
Cody
Telerik team
answered on 18 Aug 2011, 03:23 PM
Hello Mariko,

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
Vote for Telerik Test Studio at the Annual Automation Honors Voting!
Tags
General Discussions
Asked by
Mark
Top achievements
Rank 1
Answers by
Anthony
Telerik team
Mark
Top achievements
Rank 1
Cody
Telerik team
Mariko
Top achievements
Rank 1
Share this question
or