Best Practices for Capturing Screen Elements from Browsers
Below are best practices related to capturing screen elements from a web application. For instructions on how to perform these changes, see here.
To help you and others identify captured screen elements in the Asset Tree, you should rename elements in the hierarchy as follows:
-
Rename the captured screen element with a meaningful name
-
Rename the HTML document with a meaningful name
-
Rename the top screen element under the process with the application name
Make sure that only the elements listed above are set to Available for Use.
For example, after capturing the search bar at https://www.nice.com/
the indicated elements should be renamed as shown. These should be the only elements visible in the Asset Tree.
Follow the guidelines below when selecting recognition properties for each screen element in the hierarchy:
-
Select as few recognition properties as possible.
-
The order of preference for recognition properties is:
-
ID
-
Selectors
-
XPath
-
All other properties
-
If the XPath is larger than five objects, look for anchor elements using the Web analyzers. If you must use XPath or selectors:
-
Select an anchor element as close to the captured element as possible.
-
XPath only needs to be defined up to the anchor element. Fewer elements between the anchor and the captured element result in a more stable capture.
-
Look for a parent non-visible element with a name or ID tag to use as an anchor. DIV elements are good candidates for anchors.
Capturing data from tables can be difficult, unless you only need to capture data from a specific cell that has a constant position. In other cases, you may need to use HTML Table screen elements.
To do so, manually set the identification properties for the HTML Table screen element. Use Developer mode to find the table you need in the HTML document, and then manually create the table screen element using the properties from the table element.
For an example project, see Process Tables.
-
Only enable the Dynamic Document option for HTML Document elements if the web pages contents update dynamically. Do not select this option unnecessarily as the frequent scanning of a web site slows performance.