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

Automating Silverlight checkbox

2 Answers 55 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Melinda
Top achievements
Rank 1
Melinda asked on 11 Jun 2012, 10:31 PM
Hello all,


I'm new to using Test Studio for automation testing, so I apologize if this ends up being a basic question.

I have a Silverlight pop-up window that I'm trying to automate and I've able to use Test Studio to record all of the steps. However, when I run the test it fails to click on a check-box like it's supposed to. That step is simply "Click 'ObjectTag'" and the code behind simply looks like this:

/// <summary>
            /// Find logic
            /// (Html): [id 'Exact' silverlightControlHost][tagIndex 'Exact' object:0]
            ///
            /// </summary>
            public ArtOfTest.WebAii.Controls.HtmlControls.HtmlControl ObjectTag
            {
                get
                {
                    return Get<ArtOfTest.WebAii.Controls.HtmlControls.HtmlControl>("id=silverlightControlHost", "|", "tagIndex=object:0");
                }
            }


I attempted to write some code to select the check-box, but because of it being a Silverlight page I've been unable to do so.

I also have a very hard time with Test Studio and the Silverlight pop-up window. I haven't been able to get the hover feature to work in the Silverlight window the way that it does on a normal page, so I can't get it to single out the checkbox at all. I'm guessing that is why I'm just getting the "Click 'ObjectTag'" for that step.

Any recommendations? I'm using Visual Studio 2010 and Internet Explorer 8.

2 Answers, 1 is accepted

Sort by
0
Melinda
Top achievements
Rank 1
answered on 12 Jun 2012, 12:04 AM
I upgraded my version of Silverlight (which I don't think made a difference) and I tried what was suggested in this thread:

http://www.telerik.com/automated-testing-tools/community/forums/test-studio/general-discussions/cannot-get-it-to-record-silverlight.aspx

After reconfiguring the recorder I now get "Click on Item0Radiobutton" when I click on a radio button. The checkbox I'm trying to select is part is a grid header, so for it I get "gridviewheadercell: sort column at index '0'."

Hovering over an item still doesn't produce anything, even with the hovering enabled. I'd really like to be able to single out the checkbox, instead of just the grid header.
0
Anthony
Telerik team
answered on 14 Jun 2012, 07:56 PM
Hello Melinda,

This issue sounds specific to your application. Do you encounter similar difficulties when testing against the Telerik Silverlight demos or the Microsoft Silverlight demos? If you provide us access to your app, we can test it directly to troubleshoot further. If that information is too sensitive for a forum, please provide it in a support ticket and reference this thread.

Also review this article which may assist you in getting the highlighting to work properly.

Kind regards,
Anthony
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
Tags
General Discussions
Asked by
Melinda
Top achievements
Rank 1
Answers by
Melinda
Top achievements
Rank 1
Anthony
Telerik team
Share this question
or