In a locator for identifying a control during replay you can use a pre-defined set of locator attributes, for example caption and automationId, which depend on the technology domain. But you can also use every property, including dynamic properties, of a control as locator attribute. A list of available properties for a certain control can be retrieved with the GetPropertyList method. All returned properties can be used for identifying a control with a locator.
browser.Find("//SLButton[@IsKeyboardFocused=true]")or alternatively
Dim button = dialog.SLButton("@IsKeyboardFocused=true") This works because
Silk4NET exposes a property called
IsDefault for the
Silverlight button control.
Dim button = browser.Find("//SLButton[@FontSize=12]")or alternatively
Dim button = browser.SLButton("@FontSize=12") This works because the underlying control in the application under test, in this case the
Silverlight button, has a property called
FontSize.