It is important to understand that Silk Performer does not randomly select attribute names on the fly, the attribute names which are chosen during the browser driven recording are determined by an algorithm that ranks the XPath locators (which the attribute names are contained) of a site based on several factors such as uniqueness, length, penalty for attribute names and values to ignore. When the ranking has been determined, the XPath locator which has officially been ranked highest will be used during record, this more often than not would be an XPath locator which contains an attribute name such as 'id' or 'name' - an attribute which uniquely identifies an element on a page. Along with this highest ranked locator, will be a group of "winners" that also meet the factors outlined previously, but fall short of being determined the highest ranking locator. To successfully utilize the 'Preferred DOM Attribute name' option within Silk Performer, you will need to be aware of what is the highest ranking locator of the element and also what locators are deemed as "winnners", if your attribute name belongs to a locator which is in this group, then this DOM attribute name can be used within 'Preferred DOM Attribute name' list. Please refer to an example of this option, Borland Demo application will be used to show example: Example: During a standard recording against the demo application, the locator //INPUT[@id='login-form:email'] is utilized for the email textbox, this is seen as the highest ranking locator for this specific element. To determine what could be the next highest ranking locator, add the DOM attribute name to the 'Ignored DOM attribute name' list via Silk Performer | Settings | Active Profile | Web (Browser Driven) | Record. During the next recording against the application, the recorder will now ignore the highest ranking locator, as it contains an attribute name which we have included within the Ignored Attribute Name list, and will pick a locator from the 'winners' group. See the image below The locator which contains the DOM attribute name - 'name' is now used during our next recording. With this test, we have now determined that the attribute 'name' is part of a locator within the 'winners' group, and can be used as a preferred DOM attribute. Add the DOM attribute 'name' to the 'Preferred DOM attribute names list and remove the 'id' DOM attribute name from the ignored list (as you will be forcing the use of 'name' anyway). During our next recordings, the locator with the DOM attribute 'id' will not be used, but instead the locator with the DOM attribute 'name' will be utilized in its place because the locator which the attribute name is part meets factors outlined to uniquely identify an element on a page. Incident #2574602 Old KB# 36056 Created On: 04 July 2012
↧