Attributes for Java AWT/Swing Applications

When a locator is constructed, the attribute type is automatically assigned based on the technology domain that your application uses. The attribute type and value determines how the locator identifies objects within your tests.

Supported attributes for Java AWT/Swing include:
  • caption
  • priorlabel: Helps to identify text input fields by the text of its adjacent label field. Every input field of a form usually has a label that explains the purpose of the input. For controls that do not have a caption, the attribute priorlabel is automatically used in the locator. For the priorlabel value of a control, for example a text input field, the caption of the closest label at the left side or above the control is used.
  • name
  • accessibleName
  • Swing only: All custom object definition attributes set in the widget with putClientProperty("propertyName", "propertyValue")
Note: Attribute names are case sensitive, except for mobile applications, where the attribute names are case insensitive. Attribute values are by default case insensitive, but you can change the default setting like any other option. The locator attributes support the wildcards ? and *.