HTML defines a common attribute ID that can represent a stable identifier. By definition, the ID uniquely identifies an element within a document. Only one element with a specific ID can exist in a document.
However, in many cases, and especially with AJAX applications, the ID is used to dynamically identify the associated server handler for the HTML element, meaning that the ID changes with each creation of the Web document. In such a case the ID is not a stable identifier and is not suitable to identify UI controls in a Web application.
A better alternative for Web applications is to introduce a new custom HTML attribute that is exclusively used to expose UI control information to Silk4J.
Custom HTML attributes are ignored by browsers and by that do not change the behavior of the AUT. They are accessible through the DOM of the browser. Silk4J allows you to configure the attribute that you want to use as the default attribute for identification, even if the attribute is a custom attribute of the control class. To set the custom attribute as the default identification attribute for a specific technology domain, click and select the technology domain.
The application developer just needs to add the additional HTML attribute to the Web element.
<A HREF="http://abc.com/control=4543772788784322..." <IMG src="http://abc.com/xxx.gif" width=16 height=16> </A>
<A HREF="http://abc.com/control=4543772788784322..." AUTOMATION_ID = "AID_Login" <IMG src="http://abc.com/xxx.gif" width=16 height=16> </A>
…//DomLink[@AUTOMATION_ID='AID_Login'
ID = 'gwt-uid-<nnn>'In this case <nnn> changes frequently.