Fine-tuning the Step Element Detection

Modified on Mon, 14 Aug, 2023 at 10:57 AM

When you are creating a Journey step, most of the times, it is just enough to select the target element graphically, by using the element selector. But sometimes, in order to make sure that the element is found, you need to fine-tune the element detection.


Cases when fine-tuning may be required:


  • the Step/Tip does not appear on the screen although you see the target element on the screen.
  • the Step/Tip appears on a different element that you have not selected.
  • You need to attach a Step/Tip to a low score element.


To adjust the detection criteria, open the "Selector Precision" dialog by clicking on following icon:  


In the latest releases (19.2 and forward) you can see the reliability score of the element selected inside the selector precision pop-up:



 


This will also help when you modify the parameters below, as the reliability will be updated according to the changes:




 


Detect Element by


The target element is detected if all active filters are good enough to identify it. To improve it, you can select specific attributes that are stable and trustworthy, and deselect the ones that might be constantly changing and therefore will not be reliable for the detection of the Step/Tip. The score will dynamically increase/decrease as soon as you start modifying the parameters.



 


Element ID


The Element ID is usually the best reliable and robust criteria to search for an element.

When it is considered reliable, having only this criteria selected might be enough to find the element.


In the case the element ID is not reliable (you can identify an unreliable ID by locking at its composition, if you see a lot of Numbers/letter that don't make sense, it will be most likely dynamic), its best to unselect it and use instead other parameters to find the element. 


If only some specific element IDs are not reliable, you have the option to mark only those as not reliable so they are automatically ignored, from the site settings tab in the portal, as shown in the screenshot below.



Once you fill the regular expression value ( multiple ones can be applied), Newired will automatically ignore them, streamlining the process to be always reliable and secure.

 


Text



Text filter is a good but weak parameter. It detects the element by the text you see on the screen, and It is usually better to combine it with other parameters in order to achieve more reliable results.


Avoid using texts that might change over time. It's better to use text that will be the same through time in your web-application.


In case your application has multiple languages, you can provide text filter translations so that every text will be found even with different application languages.

 


Element Attributes



Depending on type of the element selected, in this section you might see various parameters. usually we automatically select the most reliable ones.


If you decide to strengthen the selection - please pay attention if the attributes such as “style”, “width”, and other graphic-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.


We can also decide to exclude some specific classes that you know might be unreliable (same as Element IDs ), for more details on Classes, please check this Article.


Advanced settings


The Advanced selection will enable to show  the XPath and  the CSS Selector parameters.



XPath 


The XPath criteria is by default inactive because it is a quite fragile parameter. Very often the element will not be detected well because of minor changes to the page structure every time you load that page.  We suggest to use this parameter only if you know that it will be reliable, and that will depend on how the underlying application architecture works.


What are these changes we speak about?


It can be the structure changes to the page because the content / data are structurally diverse. Example: Imagine an 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 why you should be cautious about activating this filter.


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 must-have criteria.


 


CSS Selector


The CSS Selector is by default inactive because it is a quite fragile parameter as well. Very often, the element will not be detected well after there are minor changes to the page structure.


Activate it only if you understand the CSS Selector standard and the impact the parameter has on the  algorithm detection.


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. From 19.2, you can edit the CSS selector in some situations. For more details on the editable CSS Selector, click here.


 


Check this Article if you want to learn more about the Reliability of Page Elements.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article