Increase route reliability

It happens from time to time that a web page/application lacks unique identifiers for an element. Even though AppNavi's algorithm is very intelligent and uses various attributes and criteria to identify an element, it may be necessary to increase the reliability by adding additional attributes. The following picture shows a typical scenario. All form elements have identical CSS classes and no additional unique identifiers, except for the label.

1552

If, however, the label is not to be highlighted in a route step, but the parallel input field element, this can lead to problems. It is necessary to provide the input element with an additional unique attribute. In this case, AppNavi Application Custom Code can be used to ensure that the input elements are provided with an additional attribute.

var element = window.appnaviApi.utils.findElementsByText('Full Name:')[0];

window.appnaviApi.anQuery(element).closest("input").attr('anUniqueId', 'fullName');

With these two lines of code, the element is equipped with the custom attribute anUniqueId and is now reliably identifiable.