Search criteria used by the Recorder package

When you record a User Interface (UI) control with the Recorder package, a set of properties is captured; these properties are used to identify and interact with the recorded UI control during runtime.

The controls you capture using the Recorder are called objects. When the Recorder captures an object, it captures all possible properties that uniquely identify the object. The selected properties are used as "search criteria" to search and find the control from the target application during runtime.

During bot execution, the recorder goes through the target application control tree and selects the control that matches the saved properties, also known as search criteria.

By default, the recorder selects the best possible search criteria for a recorded control based on the technology. However, bots can encounter problems when trying to find previously recorded UI controls. Some of the common reasons for such failure include ,but are not limited to, the following:

  • Dynamic properties: If the properties of the captured elements change with each session or page load, and if the search criteria include any of the dynamic properties, bot can fail during runtime.
  • Frequent UI changes: If the target application is updated frequently with UI changes, and if the properties of the recorded UI controls change, bots can encounter problems when trying to recognize the recorded controls.
  • Controls with duplicate properties: If there are multiple controls with the same properties, it can result in either unintended results or bot failing to recognize the controls.

In such situations, if your bots depend solely on the default search criteria captured by the recorder, they can face difficulties in recognizing the captured controls. The captured search criteria work consistently as long as there are no other objects that match the criteria or the objects themselves are not periodically updated. Therefore, after recording UI controls, you must consider these factors and try to configure search criteria that can help your bot uniquely identify the recorded controls at the time of bot execution.

Search and validation properties for HTML technology

Search criteria is a combination of search object properties and validation properties.

Search object properties: These properties are used to locate the object from the HTML page. The following properties are used for searching the object.
  • HTML Class
  • HTML ID
  • HTML Name
  • HTML FrameSrc
  • HTML Tag
  • HTML Type
  • HTML InnerText
  • HTML FramePath
  • DOMXPath
  • Path
  • HTML HasFrame
  • FrameDOMXPath
Validation properties: These properties are validated only after the object is found. The following properties are used for validation.
  • HTML Class
  • HTML Height
  • HTML Href
  • HTML ID
  • HTML Left
  • HTML Name
  • HTML Parent
  • HTML SourceIndex
  • HTML Tag
  • HTML Title
  • HTML Top
  • HTML Type
  • HTML Value
  • HTML Width
  • HTML InnerText
  • InnerHTML
  • OuterHTML
  • IsVisible

Example of dynamic properties and using custom search criteria

Suppose certain properties of a web page that you are trying to record change at every session. Including the properties that change will result in bot failing to recognize the controls. For example, consider the sample login page shown in the following video. The ID property of the Login button changes every time the page is loaded.

When you record the Login button on the page, the recorder captures the ID as one of the default properties.


Example of a dynamic object property

If you run the bot without updating the search criteria, the bot fails during runtime because the ID of the login button keeps changing every time the page is loaded.

Search criteria error

Since the ID property keeps changing, the bot fails because it is unable to find the Login button that has the previously captured ID. So using the ID property in this scenario will not work. The problem can be easily fixed by clearing the ID property and by selecting the innerHTML property as shown in the following video. That way the bot does not look for a control with the ID btn1696911842030-8845. Instead, it will depend on the combination of the DOMXPath and innerHTML properties to uniquely identify the control.

Considerations for modifying object properties in HTML

Consider the following factors when you capture UI controls using the Recorder package:
  • If the web page that you plan to record has dynamic properties, omit them from the recorded object properties. Instead, select properties that will not change during the run time.
  • If there are multiple UI controls with the same properties, select properties that can identify a specific UI control uniquely. For example, if there are multiple buttons with the type button and if the innerHTML text (button labels) is different for each button, using the innerHTML as one of the property will help identify the control during runtime.
  • Use a dynamic or relative DOMXPath that works with layout changes. Avoid using static DOMXPaths if the layout changes or dynamic controls are added to the UI.
  • Use wildcard ('*') if certain characters of the property values are dynamic.