Reputation: 319
I want to add custom properties of my control to CodedUI test builder. How can i achieve it?
I have used Automation provider to implement support for codedUI test in the control().Only the properties returned by the AutomationElementIdentifiers are visible in the assert window now, what should i do to include the other custom properties in it?
Please guide me to resolve this.
Thanks
Upvotes: 4
Views: 2184
Reputation: 319
Thank you for your suggestion, unfortunately it doesn't works.
Finally i realize what is happening in my case, While using Automation Provider in a custom Control(like Grid) we can select the cells and can return only the properties supported by the AutomationElementIdentifiers, it is not possible to return the custom properties of the control to the test builder.
In case of control type i can return only the controltypes comes under the AutomationIdentifier.
So for my grid cell i used ControlType.Edit, but its not much helpful, the values in the Grid cells are not returned. So i decided implement the CodedUI support for my control as described in MSDN .
Thanks
Kalai
Upvotes: 1
Reputation: 10258
The following is an example of adding custom properties to a link, but it applies to any other control.
HtmlHyperlink myLink;
myLink.SearchProperties.Add("InnerText", "Custom Inner Text", PropertyExpressionOperator.EqualTo);
I have never actually used the following and not sure if it even applies to coded-ui, but I know it exist.
myLink.SetProperty("PropertyName", "Something");
Upvotes: 1