Micro Focus UFT Tutorial – An Overview of UFT

Unified Functional Testing (UFT) is an advanced and powerful tool to do functional as well as regression test automation for a software application. UFT provides out of box support for web services API testing and no longer requires web services add-in. This feature is available in UFT 11.50 onwards. You can test web services in UFT by using UFT API testing features.

Language supported by UFT

Primarily UFT uses VB Script as a scripting language. However, UFT also supports javascript, and Windows shell script.

Technologies support by UFT

UFT supports different flavors following technologies

  • Delphi 
  • Flex 
  • Java 
  • Mobile 
  • .NET
  • Oracle 
  • PeopleSoft 
  • PowerBuilder 
  • Qt 
  • SAP Solutions
  • Siebel 
  • Standard Windows Testing Support
  • Stingray 
  • Terminal Emulator 
  • VisualAge Smalltalk 
  • Visual Basic 
  • Web 
  • Windows

Operating systems supported by UFT

The following versions of Windows OS are supported by UFT

  • Server 2008 R2 SP1
  • Windows 7 SP1 (32-bit)
  • Windows 7 SP1 (64-bit)
  • Windows 8.1
  • Server 2012
  • Server 2012 R2
  • Windows 10 (Version 1511, 1607)
  • Windows 10 (64-bit) (Version 1703)
  • Windows 10 (64 –bit)(Version 1709)
  • Windows Server 2016 

Browser Supported by UFT

  • Internet Explorer version 10 to 11.00 EPM *
  • Edge version 13.10586 – 14.14393 and 15.15063
  • Firefox version 38 and earlier.38 to 56. 57, 58 Beta
  • Chrome version 18.00 to 64 Beta
  • Safari on Mac version 9.x to 10.x

How UFT Identifies Objects

UFT Tutorial - Object-identification in UFT

Every software application consists of different objects like buttons, Text Boxes, Radio buttons, and drop-downs, etc. For UFT every object is a test object and each object has certain properties (e.g. ID, Name, Index, etc.).

During the recording of a script, UFT learns the properties of the objects on which an operation is performed and stores the test objects in a file called Object Repository

At the time of execution, UFT compares the stored object properties with actual object properties. If the stored object properties match with the runtime object properties, UFT uniquely identifies the object and perform the required operation else it throws runtime error “Cannot identify Object not found”

Let’s consider the following example:

Below is a sample screenshot of the HP Mercury demo tour application.

                            UFT Sign-on button

The following is the HTML Source Code for the SIGN-ON hyperlink.

The following are a few key properties of the SIGN-ON hyperlink.

  • HTML Tag for the hyperlink is “A
  • HTML Text is “SIGN-ON

If you open the object repository, you will see the above two properties in the Test Object Details section.

Now let’s see what happens after modifying the SIGN-ON text to SIGN-IN

At runtime, there happens a mismatch in the text property of the SIGN-ON test object and the script shows the error “Cannot identify the object <<Test Object Name>>. In this case, the test object is the SIGN-ON hyperlink.

UFT Sign-on error

If you restore the changes of the test object the script will click on the SIGN-ON hyperlink.  

Mandatory and Assistive properties

Mandatory properties, as the name itself, suggests are the main and core object properties of the object. At runtime initially, UFT tries to identify an object by its mandatory properties. If the mandatory property values are not sufficient to uniquely identify the object, UFT adds some assistive properties and/or an ordinal identifier to create a unique description.
 
Let’s try to understand this with an example: 
 

Object-Identification-UFT

The above screenshot shows the mandatory as well as assistive properties of a link object. Both the properties are configurable. You can adjust it by click on the “Add/Remove” button.
 

As per the above screenshot, “html tag” and “text” of the link are the mandatory properties. During execution, if UFT is not able to uniquely identify the object it will start adding one assistive property with one mandatory property one by one until UFT is able to identify the required object.

Ordinal identifiers

Ordinal-Identifier-UFT

If mandatory properties and assistive properties together are not sufficient to uniquely identify an object then UTF uses an Ordinal identifier along with mandatory properties and assistive properties to uniquely identify the required object.
 
Example:
 
If there are two links object on the screen having the same text and URL, then we can use the ordinal identifiers to identify one of the objects.

 

 

Types of ordinal Identifier

There are three types of ordinal identifier.
  1. Index
  2. Location
  3. Creation Time (applicable only for web browser and no other objects)
Index: Indicates the order in which the object appears in the application code relative to other
 
objects. The indexing counter starts from 0. Therefore, if you use Index:=1 to describe a WebEdit test object, UFT will look for the second WebEdit object on the page rather than the first object.
 
Example: The following statement refers to the third text box on the page
                 WebEdit(“Name:=UserId”, “Index:=2”) 
 
Location: Indicates the order in which the object appears within the parent window, frame, or dialog box relative to other objects with an otherwise identical description. 
 
ExampleWebEdit(“Name:=UserId”, “Location:=2”) 
 

Now it seems that both Index and location are the same. So, what the difference between them.

The Index is the order, a developer has coded the controls inside the application. However, Location is the order in which it appears on the screen.

UFT Win Object

So if a developer creates a “Next” button first and then a “Back” button, although if the “Back” button appears on the screen first but the index for the button will be 1, and the index for the Next button will be 0. 
 
CreationTime: Indicates the order in which the browser was opened relative to other open browsers with an otherwise identical description.

Creation time is assigned to the browsers in the sequence they are opened. If you have opened three different browsers, the creation time of the first browser would be 0, and so on.

Smart Identification

When UFT uses the learned description to identify an object, it searches for an object that matches all of the property values in the description.

If UFT is unable to find any object that matches the learned object description, or if it finds more than one object that fits the description, then UFT ignores the learned description and uses the Smart Identification mechanism (if defined and enabled) to try to identify the object.
 
Base Filter Properties
 

These are the most fundamental properties of a particular test object class; those whose values cannot be changed without changing the essence of the original object. For example, if a Web link’s tag was changed from “Html tag:=A” to any other value, you could no longer call it the same object.

Optional Filter Properties

Optional Filter Properties. Other properties that can help identify objects of a particular class. These properties are unlikely to change on a regular basis but can be ignored if they are no longer applicable.
 

Visual Relation Identifiers (VRI)

Visual Relation Identifier also called VRI is a new feature in UFT that identifies an object using its relative location, relation, and distance from neighboring objects. To know more about the Visual Relation Identifier, please refer to my post How to Use Visual Relation Identifier in UFT with Example.

 

Recommended Posts

Leave a Reply