Identifying objects during a run session

Relevant for: GUI tests and components

UFT uses a human-like technique for identifying objects during the run session.

How UFT finds an object in run-time

Suppose as a continuation to the experiment, Alex is now asked to identify the same "item" he initially identified but in a new, yet similar environment.

The first photograph he is shown is the original photograph. He searches for the same Caucasian girl, about eight years old, with long, brown hair that he was asked to remember and immediately picks her out. In the second photograph, the children are playing on the playground equipment, but Alex is still able to easily identify the girl using the same criteria.

Similarly, during a run session, UFT searches for a run-time object that exactly matches the description of the test object it learned previously. It expects to find a perfect match for both the mandatory and any assistive properties it used to create a unique description while learning the object. As long as the object in the application does not change significantly, the description learned is almost always sufficient for UFT to uniquely identify the object. This is true for most objects, but your application could include objects that are more difficult to identify during subsequent run sessions.

For example, Alex is told he will have to recognize a particular tree out of multiple trees in the photo, and he knows he is going to have to be able to identify it again in a photo taken from a different angle. If there isn't enough clearly identifying information about the tree itself, then he might take note of where the tree is located relative to some other permanent item, such as a nearby lamp post or picnic table. Then he will be able to identify the tree again, even if the next picture he sees is from a different angle (as long as all the required items are still visible in the picture).

This is similar to the visual relation identifier property, which enables UFT to identify test objects according to their neighboring objects in the application. You use this property to link less stable test objects to more unique test objects, and as long as those objects in the application maintain their relative location to your object, UFT should still be able to identify the test object even after predictable user interface changes in the application.

Consider the final phase of Alex's experiment. In this phase, the tester shows Alex another photograph of the same family at the same location, but the children are older and there are also more children playing on the playground. Alex first searches for a girl with the same characteristics he used to identify the girl in the other pictures (the test object), but none of the Caucasian girls in the picture have long, brown hair. Luckily, Alex was smart enough to remember some additional information about the girl's appearance when he first saw the picture the previous week. He is able to pick her out (the run-time object), even though her hair is now short and dyed blond.

How is he able to do this? First, he considers which features he knows he must find. Alex knows that he is still looking for a Caucasian female, and if he were not able to find anyone that matched this description, he would assume she is not in the photograph.

After he has limited the possibilities to the four Caucasian females in this new photograph, he thinks about the other characteristics he has been using to identify the girl—her age, hair color, and hair length. He knows that some time has passed and some of the other characteristics he remembers may have changed, even though she is still the same person.

Thus, since none of the Caucasian girls have long, dark hair, he ignores these characteristics and searches for someone with the eyes and nose he remembers. He finds two girls with similar eyes, but only one of these has the petite nose he remembers from the original picture. Even though these are less prominent features, he is able to use them to identify the girl.

UFT uses a very similar process of elimination with its Smart Identification mechanism to identify an object, even when the learned description is no longer accurate. Even if the values of your description properties change, UFT maintains the reusability of your test or component by identifying the object using Smart Identification. For details on Smart Identification, see Configuring Object Identification.

The remainder of this Help assumes familiarity with the concepts presented here, including test objects, run-time objects, description properties (including mandatory and assistive properties), visual relation identifiers, and Smart Identification. An understanding of these concepts will enable you to create well-designed, functional tests and components for your application.

Back to top

Description properties vs. runtime properties

UFT uses unique terms to differentiate between the properties and operations for test objects and run-time objects.

Test Objects

Run-time Objects

description properties are UFT-specific properties that UFT uses to identify objects in applications, to retrieve and store information about those objects, or to compare stored values with the current values of an object in an application.

The description properties available for a test object are determined by its test object class (and not by the actual properties available for the object in the application).

Native properties are the properties created by the object creator for each run-time object. (Examples of object creators include Microsoft for Microsoft Internet Explorer objects and the product developer for ActiveX objects.)

A test object operation is a method or property that UFT can perform on an object from a particular test object class.

Example: UFT can perform the Click method on a WebButton test object.

Native operations are the methods of the object in your application as defined by the object creator.

Back to top

Defining run-time properties

View and modify properties and operations for test objects and run-time objects in a number of ways:

  • View the syntax of the native operations of any visible object using the Operations tab of the Object Spy. For details, see Use the Object Spy.

  • Retrieve native property values from the run-time object during the run session by adding GetROProperty statements. For details, see Retrieving and setting values.

  • If the available test object operations and description properties do not provide the functionality you need, access the internal operations and native properties of the run-time object using the Object property or the attribute object property for Web objects. For details, see Native properties and operations and the Objectproperty in the Common Methods and Properties section of the UFT Object Model Reference for GUI Testing.

    Note: When using Insight test objects, which UFT recognizes in the application based on the object's appearance, UFT does not use the object's programming interface and therefore native operations and properties are not relevant.

Back to top