Book Image

TestComplete Cookbook

By : Gennadiy Alpaev
Book Image

TestComplete Cookbook

By: Gennadiy Alpaev

Overview of this book

<p>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.</p> <p>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.</p> <p>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.</p> <p>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.</p> <p>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.</p>
Table of Contents (19 chapters)
TestComplete Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Viewing variables' values


During the script debugging, there often arises a need to look at the current values of the variables used in the script.

In this recipe we will deal with several methods of doing this.

Getting ready

Launch a standard Windows Notepad application (C:\Windows\notepad.exe).

How to do it...

In order to familiarize ourselves with the lookup possibility of the variable values, we will need to write a small script with the use of different variable types.

  1. Write the following function:

    function testDebug1()
    {
      var pNotepad = Sys.Process("notepad");
      var num = 15.8;
      var str = "string value";
      var bool = true;
      Log.Message("Dummy message");
    }
  2. Set the breakpoint on the last line, where the Log.Message method call takes place (set the cursor on the line and press F9 button).

  3. Launch the function. In the result, the function execution will pause on the line with the breakpoint and we will be able to look up the values of all the created variables.

  4. In the lower part of the TestComplete...