Book Image

Advanced UFT 12 for Test Engineers Cookbook

Book Image

Advanced UFT 12 for Test Engineers Cookbook

Overview of this book

Table of Contents (18 chapters)
Advanced UFT 12 for Test Engineers Cookbook
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Utility statements


UFT uses VBScript as its programming language, but it also has a wide array of commands that are very useful for various purposes, such as flow control. In this section, we shall provide a list of commonly used commands and some others, which the authors think are useful, accompanied by examples and explanations.

Getting ready

From the File menu, navigate to New | Test, or use the Ctrl + N shortcut.

How to do it…

Proceed with the following steps:

  1. DescribeResult: This returns a text description of the specified error code. For example, to print the description of the last runtime error, use:

    Print DescribeResult(GetLastError())
  2. ExecuteFile: This is used to execute the VBScript code in a file (function library) during runtime. This means, instead of associating a function library to your test during design time via the UFT GUI (via File | Settings | Resources), you can call it directly using the following syntax:

    ExecuteFile FilePathname
  3. After the statement is executed, all the...