TestComplete Cookbook

TestComplete Cookbook
eBook: $29.99
Formats: PDF, PacktLib, ePub and Mobi formats
save 20%!
Print + free eBook + free PacktLib access to the book: $79.98    Print cover: $49.99
save 37%!
Free Shipping!
UK, US, Europe and selected countries in Asia.
Also available on:
Table of Contents
Sample Chapters
  • Learn to produce easily modifiable and maintainable scripts
  • Customize convenient and optimal launches of created tests
  • Explore TestComplete’s possibilities and advantages through illustrative examples and code implementations

Book Details

Language : English
Paperback : 282 pages [ 235mm x 191mm ]
Release Date : January 2014
ISBN : 1849693587
ISBN 13 : 9781849693585
Author(s) : Gennadiy Alpaev
Topics and Technologies : All Books, Cookbooks

Table of Contents

Chapter 1: Getting Started
Chapter 2: Working with Tested Applications
Chapter 3: Scripting
Chapter 4: Running Tests
Chapter 5: Accessing Windows, Controls, and Properties
Chapter 6: Logging Capabilities
Chapter 7: Debugging Scripts
Chapter 8: Keyword Tests
Chapter 9: Data-driven Testing
Chapter 10: Testing Web Applications
Chapter 11: Distributed Testing
Chapter 12: Events Handling
  • Chapter 1: Getting Started
    • Introduction
    • Installing TestComplete
    • Creating your first project
    • Choosing a scripting language for the project
    • Recording your first test
    • Modifying the recorded test
    • Saving and restoring user settings
    • Creating code templates
    • Delaying script execution
    • Adding and removing project items
    • Understanding how TestComplete interacts with tested applications
    • Understanding Object Browser
    • Using Object Spy
  • Chapter 2: Working with Tested Applications
    • Introduction
    • Adding a tested application project item
    • Running a tested application from the script
    • Terminating a tested application
    • Killing several instances of a tested application
    • Closing a tested application
    • Running a tested application in the Debug mode
    • Running a tested application under a different user account
    • Changing tested application settings dynamically from the script
    • Running external programs and DOS commands
    • Testing installers – running an MSI file
  • Chapter 3: Scripting
    • Introduction
    • Entering text into text fields
    • Using wildcards to process objects with variable names
    • Structuring code using loops
    • Creating property checkpoints
    • Creating object checkpoints
    • Using global variables
    • Testing multilingual applications
    • Working with nonstandard controls
    • Organizing script code in the project
    • Handling exceptions
    • Handling exceptions from a different unit
    • Creating framework using the OOP approach
  • Chapter 4: Running Tests
    • Introduction
    • Running a single function
    • Verifying test accuracy
    • Creating a test plan for regular runs
    • Running tests from the command line
    • Passing additional parameters to test from the command line
    • Organizing test plan runs
    • Scheduling automatic runs at nighttime
    • Running tests via Remote Desktop
    • Changing playback options
    • Increasing run speed
    • Disabling a screensaver when running scripts
    • Sending messages to Indicator
    • Showing a message window during a script run
  • Chapter 5: Accessing Windows, Controls, and Properties
    • Introduction
    • Choosing Object Tree Model
    • Understanding the window's life cycle
    • Ignoring overlapping windows
    • Dragging one object into another
    • Calling methods asynchronously
    • Verifying if an object has a specific property
    • Finding objects by properties' values
    • Waiting for an object to appear
    • Waiting for a property value
    • Mapping custom control classes to standard ones
    • Using text recognition to access text from nonstandard controls
    • Using Optical Character Recognition (OCR)
    • Dealing with self-drawn controls not supported by TestComplete
  • Chapter 6: Logging Capabilities
    • Introduction
    • Posting messages to the log
    • Posting screenshots to the log
    • Creating folders in the log
    • Changing log messages' appearance
    • Assessing the number of errors in the log
    • Changing pictures' format
    • Comparing screenshots with dynamic content
    • Decreasing log size
    • Generating log in our own format
    • Exporting log to MHT format
    • Sending logs via e-mail
  • Chapter 7: Debugging Scripts
    • Introduction
    • Enabling and disabling debugging
    • Using breakpoints to pause script execution
    • Viewing variables' values
    • Debugging tests step by step
    • Evaluating expressions
  • Chapter 8: Keyword Tests
    • Introduction
    • Recording and understanding Keyword Tests
    • Adding new actions to existing Keyword Tests
    • Enhancing Keyword Tests using loops
    • Creating object checkpoints
    • Calling script functions from Keyword Tests
    • Converting Keyword Tests to scripts
    • Creating our own Keyword driver
  • Chapter 9: Data-driven Testing
    • Introduction
    • Generating random data for tests
    • Accessing a specific cell in a table
    • Reading all data from a table
    • Using DDT tables for storing expected values
    • Changing CSV delimiter and other parameters
    • Driving data without using loops
    • Accessing Excel spreadsheets without having MS Office installed
    • Auto-detecting Excel driver
  • Chapter 10: Testing Web Applications
    • Introduction
    • Choosing Web Tree Model
    • Using updates for the latest browser versions
    • Performing cross-browser testing
    • Verifying if a text exists on a page
    • Waiting for an element to appear on a page
    • Saving screenshots of an entire page
    • Running scripts on a page
  • Chapter 11: Distributed Testing
    • Introduction
    • Setting up Network Suite and understanding distributed testing
    • Copying Project Suite to a Slave workstation
    • Using a Master workstation to run tests
    • Using different configuration files for each workstation
    • Sharing data between workstations
    • Synchronizing test runs on several workstations
  • Chapter 12: Events Handling
    • Introduction
    • Creating event handlers
    • Disabling the postage of certain error messages
    • Clicking on disabled controls without an error message
    • Handling unexpected windows that affect TestComplete
    • Handling unexpected windows that don't affect TestComplete
    • Saving the log to a disk after each test
    • Sending a notification e-mail on timeouts
    • Creating preconditions and postconditions for tests

Gennadiy Alpaev

Gennadiy Alpaev has been working as a test automation engineer since he graduated in 2003. During these 10 years he has worked with many automation tools including TestComplete, SilkTest, Selenium, and Squish and participated in more than 10 projects, both as an employee and on contract basis. He gained his first experience of writing tutorials when he created a tutorial on SilkTest together with his colleague Mykola Kolisnyk. His second big project on test automation was a complete tutorial on TestComplete. These two tutorials are available online in Russian. Starting in 2011, he is running online and on-site courses on TestComplete and test automation for independent students and companies. He is also actively participating in different forums trying to help others solve problems as fast as possible. The main principles that he follows in his training are simplicity and brevity, especially when explaining complex things.
Sorry, we don't have any reviews for this title yet.

Code Downloads

Download the code and support files for this book.

Submit Errata

Please let us know if you have found any errors not listed on this list by completing our errata submission form. Our editors will check them and add them to this list. Thank you.

Sample chapters

You can view our sample chapters and prefaces of this title on PacktLib or download sample chapters in PDF format.

Frequently bought together

TestComplete Cookbook +    Getting Started with Citrix XenApp 6.5 =
50% Off
the second eBook
Price for both: £29.05

Buy both these recommended eBooks together and get 50% off the cheapest eBook.

What you will learn from this book

  • Learn to install and provide appropriate settings for TestComplete
  • Record, modify, and manual code scripts
  • Learn to create keyword tests by the automation specialists
  • Customize effective launches of the tests (including distributed launching on several computers)
  • Learn to debug scripts, and search and correct errors
  • Discover how to work with desktop applications and web-applications
  • Understand how to use log formatting and log generation in a proper format
  • Get to grips with how to work with non-standard controls elements

In Detail

TestComplete is an automated testing tool, designed for advanced and novice testers alike, to create, manage and run tests for any desktop, Web or rich client software. It does not depend on any development tool, or application type. Your tests will work fine with any application regardless of whether it was created in C#, C++, Delphi, Java, or any other development language. TestComplete is the most efficient tool of its kind, in regards to the price and quality of the product.

This guide takes a refined approach towards quickly learning the capabilities of TestComplete, using relevant illustrations and practical examples. Each example is consonant with true-to-life situations, which testers would come across sooner or later, while automating tests. With the help of these examples, we will look into complex themes and learn how to test web applications in the most effective manner.

Throughout the first chapters, we will be dealing with some fairly simple tasks that are of interest to people new to TestComplete, gradually moving towards advanced-level automation approaches, which are riveting both for novices and experienced TestComplete users.

We will explore various methods of tests creation for study (e.g. recording, modification and manual coding with use of different approaches), learn test creation using different methods(each of them being suitable for a specific use-case), learn how to distinguish between different methods for accessing controls elements, selecting a most appropriate approach for each of the cases in view. We will also undertake distributive testing for the sake of shortening the overall time for test launches.

This practical guide will help you to answer frequently asked questions relating to automation testing and set the tone for the correct direction of your advancements, which are instrumental to organizing automation in your project.


A practical cookbook, with a perfect package of simple, medium, and advanced recipes targeted at basic programmers as well as expert software testers, who will learn to create, manage, and run automated tests. It is packed with problem-solving recipes that are supported by simple examples.

Who this book is for

If you are a software tester or a programmer who is involved with testing automation using TestComplete, this book is ideal for you! You will be introduced to the very basics of using the tool, as well as polish any previously gained knowledge in using the tool. If you are already aware of programming basics, but are new to TestComplete, you will also be able to quickly learn the concepts through selected examples that are easily scalable for your specific needs.

Code Download and Errata
Packt Anytime, Anywhere
Register Books
Print Upgrades
eBook Downloads
Video Support
Contact Us
Awards Voting Nominations Previous Winners
Judges Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software
Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software