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

Preface

HP QuickTest Professional is a test automation tool for functional and regression testing for software applications and environments. HP QuickTest Professional supports keyword and scripting interfaces and features a graphical user interface. It uses the Visual Basic Scripting Edition (VBScript) to specify a test procedure and to manipulate the objects and controls of the application under testing.

This book is a great platform for sharing my knowledge of designing and implementing the test automation framework that I have acquired over the years, while working in Information Technology and teaching QTP to professionals. If any professional or student finds it difficult to implement frameworks, this is the right book—one which teaches approaches and concepts with simple examples. This book covers the managerial, technical, and design concepts, and is uniquely designed to deliver the knowledge needed to create an effective framework. It demonstrates easy ways to implement and learn concepts, along with code and suggestions for creating a portable framework across various versions of QTP.

This book also covers the new features for creating test automation using XPath in QTP and JavaScript for automated web applications.

What this book covers

Chapter 1, Automation Life Cycle and Automation Goals, explains the automation life cycle and tool selection which helps to implement better processes for test automation and tool selection. This chapter also explains the overall automation and design goals that help develop a better test automation framework and guides you towards implementing better practices to achieve maximum output.

Chapter 2, Essentials of Automation, explains the key elements for designing test automation using QTP along with examples on how to use each of them. These elements serve as the base to create a complete test automation script.

Chapter 3, Basic Building Blocks for Creating Frameworks, explains the basic code-building blocks (with examples) for designing the implementation of test automation frameworks, all of which are used in implementing the framework(s).

Chapter 4, Understanding and Creating Frameworks, explains what we mean by test automation frameworks and what types of frameworks exist. It guides you towards understanding these frameworks before we design and implement them. The chapter will also highlight the differences and commonalities among them.

It explains the basics of test automation frameworks and builds the user's maturity in implementing test automation framework(s) end-to-end.

Chapter 5, Deploying and Maintaining Frameworks, explains, in the beginning of the design phase, how and what needs to be done to maintain and enhance these frameworks with ease.

Chapter 6, DOM- and XPath-based Framework in Web Applications, explains the various web-based technologies and builds the maturity to implement these technologies for automated web-based applications. It explains HTML, XPath, DOM, JavaScript, and how to use them effectively for creating test automation scripts.

Chapter 7, Capturing the Lessons Learned, explains what should be captured for lessons to be learned and how to make sure that these lessons help in future projects or serve as input in other projects.

What you need for this book

We require the following software to get started with the book:

  • QTP 11.0

  • Windows XP or Windows 7 32 bit with IE 8

  • Patch QTPWEB_00078 for IE 9

  • Patch QTP_00699 for Windows 7 64-bit

  • Patch QTPWEB_00086 Support for 64-bit IE

Note

Before installing this patch, install the QTP_00699 patch.

Who this book is for

This book is useful for manual testers, test leads, test architects, automation engineers, and aspiring test automation engineers who want to learn, create, and maintain the framework. It allows them to accelerate the development and adaptation of the test automation framework. This book will equip the tester with the technical and conceptual know-how for creating a framework using QTP.

This book is also useful for those moving from manual testing to test automation and QTP.

Conventions

Code words in text, folder names, filenames, file extensions, pathnames, dummy URLs, and user input are shown as follows: "The <html> tag is the root node and it has no parent node."

A block of code is set as follows:

Window("WinFlight").WinButton("Insert Order").Click
'Window("WinFlight").WinButton("Button").Click
'When QTP tries to execute the below statement, application will not allows to click on the button, since it is waiting to reach progress bar to 100% and display the message Insert Done..
' Here script will fail 
' We need  to insert the dynamic synchronization  point and this waits until the text does not changes to Insert Done…
'Window("WinFlight").ActiveX("ThreedPanelControl").WaitProperty "text", "Insert Done...", 10000

New terms and important words are shown in bold. Words that you see on the screen, in menus or dialog boxes for example, appear in the text like this: "Clicking on the Next button moves you to the next screen."

Note

Warnings or important notes appear in a box like this.

Tip

Tips and tricks appear like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.

To send us general feedback, simply send an e-mail to , and mention the book title through the subject of your message.

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide on www.packtpub.com/authors.

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Downloading the example code

You can download the example code files for all Packt books you have purchased from your account at http://www.packtpub.com. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.

Errata

Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you would report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/support, selecting your book, clicking on the errata submission form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded to our website, or added to any list of existing errata, under the Errata section of that title.

Piracy

Piracy of copyright material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works, in any form, on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

Please contact us at with a link to the suspected pirated material.

We appreciate your help in protecting our authors, and our ability to bring you valuable content.

Questions

You can contact us at if you are having a problem with any aspect of the book, and we will do our best to address it.