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

Find Object Properties

9 Answers 143 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Hardeep
Top achievements
Rank 1
Hardeep asked on 23 Mar 2011, 06:10 AM
What are the steps we can follow to find the object properties in the Silverlight web application in IE browser.

I am using free Webaii framework in Visual Studio 2010.

Does Webaii framework provides any tool for that or we need to use Spy ++ . If we have to use Spy ++ then - please explain the steps to find any object property in the Silverlight web application in IE browser.

9 Answers, 1 is accepted

Sort by
0
Stoich
Telerik team
answered on 25 Mar 2011, 04:24 PM
Hello Hardeep,
    the WebAii Framework per se is just an API for UI testing.
It sounds like you need the to use Test Studio. Test Studio offers many enhanced capabilities related  to test automation. One of these is the DOM Explorer which will let you explore a Silverlight application very extensively.
You can download a Test Studio Trail from your account.

I believe Spy++ only works on certain desktop applications and can't be used for Silverlight. I have very little experience with it so I'm not sure. I'm sure you can find plenty if info on the Internet.

Hope to hear from you soon!

Best wishes,
Stoich
the Telerik team
0
Hardeep
Top achievements
Rank 1
answered on 25 Mar 2011, 05:37 PM
Hi Stoich,

Thanks for your suggestion. Right now we are just looking on evaluting WebAii free framework and automate some of the scenarios.
I have surfed on internet there are some tools avaliable to Spy Silverlight application.
Please let me now if there is any best free tool around that we can use for getting silverlight application object properties.

Thanks,
Hardeep
0
Cody
Telerik team
answered on 27 Mar 2011, 11:57 PM
Hello Hardeep,

We are not aware of any really good and free tool for fetching the properties of Silverlight elements, although we haven't done an extensive search for such a tool either. Our free framework can read most properties attached to Silverlight elements, but you have to know what property you are looking for ahead of time. Here's a code example:

Brush textblockBrush = (Brush)Pages.TelerikTreeViewFor.SilverlightApp.InstallerTextblock.GetProperty(new AutomationProperty("Foreground", typeof(Brush)));

Best wishes,
Cody
the Telerik team
0
Hardeep
Top achievements
Rank 1
answered on 28 Mar 2011, 06:48 PM
Thanks Cody,

Can you please help me out with use of this code. Like what are libraries that needs to be added and basically what are should be declare in "Using". I tried using

using Brush=ArtOfTest.WebAii.Silverlight.UI.Brush;

Brush textblockBrush = (Brush)Pages.TelerikTreeViewFor.SilverlightApp.InstallerTextblock.GetProperty(newAutomationProperty("Foreground", typeof(Brush)));

But it throws error for Pages

Can you provide me the complete code how I can print the Object properties in the silverlight application on console.

Thanks,
Hardeep
0
Cody
Telerik team
answered on 29 Mar 2011, 08:28 PM
Hello Hardeep,

To make it easy for you I've attached a complete sample VS 2010 project.

Kind regards,
Cody
the Telerik team
0
emma
Top achievements
Rank 1
answered on 04 Oct 2012, 08:29 AM
Hi, we are trying to fetch int[] property of our silverlight element using the following code:
var SelectedIndexes = grid.GetProperty(new AutomationProperty("SelectedIndexes", typeof(int[])));

The following exception occurs running the test:
Invalid cast from 'System.String' to 'System.Int32[]'.

Is int[] type supported?

Thanks very much.
0
Cody
Telerik team
answered on 04 Oct 2012, 01:37 PM
Hello Emma,

No I am sorry. We cannot handle arrays of any kind with the GetProperty function.

All the best,
Cody
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
0
Tomasz
Top achievements
Rank 1
answered on 26 Sep 2016, 11:59 AM
Hello,

is there a way to read property of WPF application element during the test? I mean (for example) that Test Studio located (during the test) an element which have text content "some text" and I need to read/check (during the test) what is the TagIndex value of that element. Maybe it is possible in the coded step? Could You tell mi some advice?
0
Elena
Telerik team
answered on 29 Sep 2016, 10:09 AM
Hello Tomasz,

This could be accomplished in a coded step. The example below is for html element but it should be applicable for a wpf element as well. Please give it a try and get back to us in case you need further assistance. 

HtmlDiv div = ActiveBrowser.Find.ById<HtmlDiv>("test");
Log.WriteLine(div.BaseElement.TagNameIndex.ToString());


Regards,
Elena Tsvetkova
Telerik by Progress
 
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
 
Tags
General Discussions
Asked by
Hardeep
Top achievements
Rank 1
Answers by
Stoich
Telerik team
Hardeep
Top achievements
Rank 1
Cody
Telerik team
emma
Top achievements
Rank 1
Tomasz
Top achievements
Rank 1
Elena
Telerik team
Share this question
or