Skip to content

Finding UI Elements

This method of finding elements is based on visual elements on the page. If you see a label with the text "Account Number", the find actions can locate elements relative to or containing that label. You can indicate from where you would like to search with the "Nearest" property which can be Any (default), Left, Right, Top, or Bottom. The find actions can be used for locating which inputs to send data. For actions like clicking or hovering the find for UI elements is built-in, so there is no need to execute a find method before clicking/hovering in this case.

Header:
  Name: Test Account Number
  ApplicationName: Bank
  RequiresLogin: False
Actions:
- Navigate:
    Url: '{endpoint}/'
- WaitForContent: {}
- Snapshot: {}
- FindTextInputs:
    Take: 1
    Nearest: Left
    Patterns:
    - 'Account Number'

Note: If you want to perform a click/hover action on an element found using the DOM-based find methods, you will not specify the pattern in the Click/Hover action. Instead you will execute the element-based find action and the click/hover will target whatever was found from the previous find. See Finding DOM Elements for more information.

The "Patterns" property is a list of patterns that you can enter to find an element. Searching on more than one pattern is a logical OR operation. Meaning, if you search on "Foo" and "Bar" it will return any UI element that matches either "Foo" or "Bar". You can also do wildcard searching with each pattern. Putting a wildcard character (*) at the beginning and/or end of the search string will determine if a StartsWith, EndsWith, or Contains will be done. Wildcard characters in the middle of the pattern is not supported.

Find methods can return more than one element. In order to further refine your result you can use the "Skip" and "Take" properties to target exactly which and how many elements you want. The default for these are to skip nothing and take everything.

The following find methods are available for UI elements:

  • FindCheckboxes
  • FindPasswords
  • FindRadioButtons
  • FindSelect
  • FindTextInputs