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

Using global variables (Environment)


The Environment object can be best described as a kind of Dictionary that holds pairs of keys and values. Unlike the native Dictionary, it has extended capacities such as the following:

  • UFT features that contain built-in variables, which can return useful values during runtime, such as ActionName, ActionIteration, TestName, TestIteration, TestDir, and OS

  • Defining test internal variables (that is, persistent) or external variables (see the following point)

  • Loading a set of variables from an external XML file, preset, or dynamically used during runtime

  • Automation Object Model (AOM) support, which enables the addition of internal variables dynamically before launching a test's run session

  • The scope of the object is global and is loaded automatically when UFT opens, as is true for all reserved objects

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. For built-in variables:

    1. Navigate...