O'Reilly logo

Designing and Implementing Test Automation Frameworks with QTP by Ashish Bhargava

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using XPath

XPath allows navigating and finding elements and attributes in an HTML document. XPath uses path expressions to navigate in HTML documents. QTP allows XPath to create the object description, for example:

xpath:=//input[@type='image' and contains(@name,'findFlights')

In the following section, we will learn the various XPath terminologies and methodologies to find the objects using XPath.

XPath terminology

XPath uses various terms to define elements and their relationships among HTML elements, as shown in the following table:

Atomic values

Atomic values are nodes with no children or parent

Ancestors

A node's parent, parent's parent, and so on

Descendants

A node's children, children's children, and so on

Parent

Each element and ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required