Book Image

Designing and Implementing Test Automation Frameworks with QTP

By : Ashish Bhargava
Book Image

Designing and Implementing Test Automation Frameworks with QTP

By: Ashish Bhargava

Overview of this book

<p>As software testing is maturing, the focus is shifting towards test automation. The key is to learn and grow skills in framework designing and start contributing to project organization goals.</p> <p>Through a helpful mix of conceptual and practical aspects, you will learn everything you need to know related to the implementation of frameworks using QTP. Through simple examples, you will gradually develop the skills needed to execute concepts and code blocks used to design and implement the test automation framework.</p> <p>This tutorial-based guide demonstrates an easy way to implement concepts to create a portable framework across the various versions of QTP. You will learn about the automation lifecycle and gradually develop technical concepts related to each phase. Within a short amount of time, you will be able to deal with challenges in test automation. "Designing and Implementing Test Automation Frameworks with QTP" uses a simple, yet elegant approach and gives the reader all the skills and knowledge they need to implement the framework.</p>
Table of Contents (15 chapters)
Designing and Implementing Test Automation Frameworks with QTP
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Free Chapter
1
Automation Life Cycle and Automation Goals
Index

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 attribute has one parent

Children

Element nodes may have zero, one, or more children

Siblings

Nodes that have the same parent

Selecting nodes

A path expression allows selecting nodes in a document. The commonly used path expressions are shown...