When you are creating a Journey step, most of the times, it is just enough to select the target element graphically using the element picker. But sometimes you need to fine-tune the element detection.
- the guidance does not appear on the screen although you see the target element on the screen - so you need to soften the element detection criteria;
- the guidance appears on the screen bind to the element that you have not selected - so you need to harden the element detection criteria.
To adjust the detection criteria, open the "Detect element by" dialog by clicking on following icon:
[portion of screenshot with step dialog and the icon to open it]\
Detect Element by
The target element is detected if all active filters are passed. Activate or Deactive the individual filters to harden/soften the criteria.
The Element ID is usually the best reliable and robust criteria to search for an element.
If your target element is not recognized well, you can try to keep this filter as only active filter so please deactivate the other filters.
In some cases the element IDs are not unique and you need to combine it with other criteria. Based on your use case you can also limit the search scope to a single page only by adding a visibility rule, for example: Match element with ID “submit” on page “/buynow”.
The important exception to reliability of ID filter are web applications with auto-generated element IDs, shortly the IDs that change in time. In such case you need to deactivate this filter and in the site administration mark the format of auto generated IDs as not reliable so they are not used anywhere else for element detection.
Text filter is a good but weak filter. It detects the elements by the text you see on the screen. It is usually necessary to combine the filter with other filters to achieve reliable results.
The Index of a text is a soft criteria, only if the combined match with other criteria will result in multiple elements passing the criteria, we take the first match as the target element.
In case your application can be displayed in multiple languages you can provide text filter translations.
Depending on type of selected element, you can filter by various attributes. The attributes that are usually reliable to be used as filters are automatically preselected.
If the guidance does not appear or appear in the wrong place, it often means you need to either soften the filter, i.e uncheck some attributes, or harden it, i.e. check some additional attributes.
If you decide to strengthen a selection - please pay attention if the attributes such as “style”, “width”, and other presentation related attributes are not dynamically derived from your screen size or environment such as operating system or browser. In such case the target element would not be detected properly in different environments.
The XPath criteria is by default inactive because it is quite fragile filter. Very often the element will not be detected well due to minor changes to the page structure. Activate it only if you understand the XPath standard and the impact the filter has on detection algorithm.
What changes to the page do we speak about?
It can be the structure changes to the page because the content / data are structuraly diverse. Example: Imagine e-shop page where you have an additional panel for business customers. In such cases if the page structure is dynamic, the XPath selector may not find the element.
Another example: it may happen that you still maintain / improve your web application. So the page structure is changing based on the improvements you are doing to the application. This is another common reason to be causios about activating XPath selector.
Important: Even if you keep the matcher inactive, we still record the XPath criteria and we use it to narrow the scope in case the active matchers will find multiple elements on the current page. But inactive criteria are not a must have criteria.
The CSS Selector is by default inactive because it is quite fragile filter as well. Very often the element will not be detected well after minor changes to the page structure.
Activate it only if you understand the CSS Selector standard and the impact the filter has on detection algorithm.
Important: Even if you keep the matcher inactive, we still record the CSS criteria and we use it to narrow the scope in case the active matchers will find multiple elements on the current page. But inactive criteria are not a must have criteria.