Web Add-in Extensibility Developer Guide > Working with Web Add-in Extensibility > Developing Support for Your Toolkit > Teaching UFT to Identify the Test Object Class to Use for a Custom Web Control > Using the Conditions Elements

Using the Conditions Elements

You can define Conditions elements in the Control\Identification\Browser element defined for a test object class. This enables UFT to identify the controls that should be represented by this test object class, based on the control's properties, without calling an identification function.

Alternatively, you can define an identification function (per test object class or for the whole toolkit) and use the conditions to limit the times UFT calls the function. You do this by defining that the identification function be called only in cases when the control's properties meet certain conditions.

You can define different sets of conditions for UFT to use when running on different browsers, or you can define one set of conditions and specify that it is relevant for all browsers. For more information, see the Browser element description in the Toolkit Configuration Schema Help.

You compose the Conditions using a set of Condition elements, joined by either and or or logic. Each Condition element specifies a certain property of the HTML control, and the expected value for that property. The condition is met if the value in the control's property matches the specified value (you can specify in the condition whether the value must be equal or not equal to the specified value). You can nest Conditions elements to create complex logic.

For each set of conditions, that is for each top-level Conditions element, you specify one of the following types, instructing UFT how to treat the control if its properties match the conditions within it:

If an identification function is defined, and checking the conditions does not enable UFT to determine whether to use the current test object class to represent the control, it calls the identification function.

The examples below illustrate different ways that you can use the Conditions element.

For information on the structure and syntax of the Conditions and Condition elements, see the Toolkit Configuration Schema Help.