ExecuteAutomation

Get and Set Properties in Coded UI Testing

When we work with UI test controls in coded UI tests they are separated into two parts: actions and properties.

Get and Set Properties

To get and set UI property value of any control, we directly set or get the value of property using
UITestControl.GetProperty()
or
UITestControl.SetProperty()
The UITestControl.GetProperty will try to get a value out from the property, for example, if we need to get a value of “DisplayText” property or “FriendlyName” property from a checkbox, then we can use the
 UITestControl.GetProperty("DisplayText")
to get the value from the control. Similarly we can set the property for a control. For more information on Get and Set property, please watch the video below Please leave your comments and thanks for reading the blog and watching the video. Thanks, Karthik KK