Retrieving data from the Environment object

This recipe will show you how to retrieve data from the Environment object, which is a kind of dictionary that stores key-value pairs. As we will see, unlike a regular dictionary, the Environment object stores two types of variables:

  • Built-in
  • User-defined

Built-in Environment variables give access to two types of information:

  • Static data such as the OS, OSVersion, LocalHostName, SystemTempDir, ProductDir (where UFT is installed), ProductName, ProductVer (UFT version), UserName (the Windows login name), and several settings such as UpdatingCheckpoints and UpdatingTODescriptions. In addition, we can retrieve information about the current test, such as TestName and TestDir (the path to the current test(s) from ...

Get Advanced UFT 12 for Test Engineers Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.