Free Sample
+ Collection

TestComplete Cookbook

Cookbook
Gennadiy Alpaev

Novice tester or expert, the 110+ recipes in this book are structured to be useful across all levels. Use them to increase your knowledge of TestComplete and ultimately master this incredibly versatile tool.
$24.00
$49.99
RRP $29.99
RRP $49.99
eBook
Print + eBook

Want this title & more?

$21.99 p/month

Subscribe to PacktLib

Enjoy full and instant access to over 2000 books and videos – you’ll find everything you need to stay ahead of the curve and make sure you can always get the job done.

Book Details

ISBN 139781849693585
Paperback282 pages

About This Book

  • 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

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.

Table of Contents

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

What You Will Learn

  • 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.

Authors

Read More

Recommended for You