System.Windows.FrameworkElement class has a property called Tag (of type object). It seems this is not exposed in ArtOfTest.WebAii.Silverlight.FrameworkElement class. Is there a way to access the value of this property from the Telerik Testing Framework?
Thanks
3 Answers, 1 is accepted
0
Accepted
Cody
Telerik team
answered on 16 Mar 2012, 08:34 PM
Hi Peter,
No I am sorry but it is not possible to reach the contents of the Tag property using Telerik Testing Framework? The problem is that there's no way to correctly serialize the data, send it across the wall (the division between the Silverlight application and the test execution code), and know how to deserialize it on the receiving end. It requires intimate knowledge of what' that "object" is before we can deserialize it for you to get at it.
Even if you tried to provide a deserialize method, there's no guarantee there's an equivalent Serialize method on the object for us to use. As a result we have blocked access to objects/types where it's basically impossible for us to know about during test execution.
Greetings,
Cody
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
Thank you for confirming that. FYI the scenario where I was hoping to use the Tag property was in identifying specific controls inside an ItemsPanel. Since these controls can't have AutomationIDs (because they are created at runtime), I was planning on binding the Tag property to a string that is known to represent the control (e.g. "RegisterButton"), so that from test code, I can locate the RegisterButton within the ItemsPanel. I have thought about creating a hidden TextBlock behind the button and binding it's Text to this string, but if there's a better way, I'd be very interested...
Peter
0
Cody
Telerik team
answered on 19 Mar 2012, 01:44 PM
Hi Peter,
If these controls are being generated dynamically at run time, and you have total control of the code, how about investigating taking advantage of SetAutomationId?
Greetings,
Cody
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings