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

SilverLight: Cannot find Find.ByAutomationId or Text option to find an element

2 Answers 91 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Sizy
Top achievements
Rank 1
Sizy asked on 05 Oct 2015, 07:44 AM

Hi I am evaluating telerik Testing Framework to Automate my test. The page "http://docs.telerik.com/teststudio/testing-framework/write-tests-in-code/silverlight-wpf-automation-wtc/locating-elements" shows that one can use "Automation Id", "ByText" etc except ByName (Which doesn't work, it doesn't find the textbox). 

Also i used "app.FindName<TextBox>("Password").Text = "xyz";"  But this throws an error saying it cannot find the element.

Please let me know what I am missing.

2 Answers, 1 is accepted

Sort by
0
Sizy
Top achievements
Rank 1
answered on 05 Oct 2015, 07:48 AM

Hi, I am sorry, i missed a lot of line i wanted to communicate. 

I am evaluating Telerik Testing Framework to Automate my test. The page "http://docs.telerik.com/teststudio/testing-framework/write-tests-in-code/silverlight-wpf-automation-wtc/locating-elements" shows that one can use "Automation Id", "ByText" etc but i dont see any of them except ByName (Which doesn't work, it doesn't find the textbox. PFA). 

Also i used "app.FindName<TextBox>("Password").Text = "xyz";"  But this throws an error saying it cannot find the element.

Note: my app is build using .XAP Silverlight .

Please let me know what I am missing.

0
Ivaylo
Telerik team
answered on 07 Oct 2015, 12:39 PM
Hello Chandan,

Yes you can locate elements in Silverlight using the AutomationID and the TextContent.

Instead of ActiveBrowser.Find you will have to use app.Find.

Please refer to the screenshot attached for more clarity.

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