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

Can we access search attributes of already searched element

1 Answer 24 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Prachi
Top achievements
Rank 1
Prachi asked on 25 Sep 2012, 08:20 AM
Hi,

Can we access search attributes like Automation Id, Name from a already searched element at runtime?

For Example - 
If I have a control with automationID and Name attributes associated with it.
return Get<ArtOfTest.WebAii.Silverlight.UI.Button>("AutomationId=SearchButton","Name=SButton","XamlTag=button");

Is there any way so that during run time i can print the AutomationId, Name, XamlTag of the control?

Thanks,
Prachi

1 Answer, 1 is accepted

Sort by
0
Plamen
Telerik team
answered on 28 Sep 2012, 08:59 AM
Hello Prachi,

Yes, all of these are properties of the FrameworkElement class. See here for more information. You can easily access them during runtime by simply referencing the desired element in the Repository. 

Here's an example:
Pages.SilverlightControls.SilverlightApp.RadGridView1Radgridview.AutomationId;
Pages.SilverlightControls.SilverlightApp.RadGridView1Radgridview.XamlTag;
Pages.SilverlightControls.SilverlightApp.RadGridView1Radgridview.Name;


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