XPath Handling

Strengthening Using XPaths


One of the ways to strengthen an element is to use XPath (XML path) to help locate it in the web page. An XPath is a query that returns one or more nodes in the DOM, according to specifications mentioned in the query.


In order to use the XPath locating tool, open the In Line Editor (ILE) to the Identify tab and toggle Expert Mode on.



Scroll down to the "Expert Identification" section. Click the Identification dropdown. You will be offered three options: Automatic (i.e. based on the above facts and anchors), XPath, and JavaScript. Select XPath.



Once selected, a box will appear where you may enter the XPath.



For example, the below XPath refers to a single cell, labelled Total Amount, in a table.


.//descendant::label[text()='Total Amount']/parent::span/parent::span/parent::span/parent::span/parent::td/parent::tr/parent::tbody/parent::table/parent::td/following-sibling::td/descendant::input




Using an XPath is a powerful way to strengthen an element, and it will override any other strengthening facts in the Identify Tab.


In addition, as an XPath indicates an element's precise location within the DOM, any updates made to your source application may impact Capriza's ability to find the control on the web page and, consequently, render the appropriate mobile control and page. Exercise caution when using XPaths with source applications that may frequently change or into which you do not have visibility.

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request


Please sign in to leave a comment.