Conditions Element

Description

A collection of identification conditions.

Important Information

  • Whenever possible, the identification conditions should enable UFT to determine whether to map the current test object class to this custom control based on the attributes of the control. When this is not possible, UFT calls an external function to assist in the identification (if one is defined). Calling such identification functions can affect performance and should be avoided when possible.
  • The external function to call for identification is specified in the CommonIdentification Element or in the Identification Element.
  • Top-level Conditions elements should be contained in a Browser element.

    If the same conditions are relevant for all supported browsers, define them within a single Browser element with the type attribute set to *

    Note: For backward compatibility, UFT also applies conditions to all browsers if the Conditions element is contained directly within the Identification element.

Attributes

Name Type Use Default Description
logic string optional and

Indicates whether to use 'and' or 'or' logic on the set of conditions in this element.

Possible values:

  • and - Condition considered satisfied only if all of the conditions defined within this Conditions element are met.
  • or - Condition considered satisfied if any of the conditions defined within this Conditions element is met.
type string optional   The type of condition. Required if the condition is not nested within another.

Possible values:

  • IdentifyIfPropMatch - If the conditions in this element are met, use the current test object class to represent the control. 
  • CallIDFuncIfPropMatch - If the conditions in this element are not met, do not use the current test object class to represent the control. 

  • SkipIfPropMatch - If the conditions in this element are met, do not use the current test object class to represent the control.

If UFT cannot determine whether to use the current test object class to represent the control based on the conditions, it calls the identification function (if specified) to assist in identification.

For a detailed description of how UFT uses these conditions, see the section titled "Teaching UFT to Identify the Test Object Class to Use for a Custom Web Control" in the UFT Web Add-in Extensibility Developer Guide.

Diagram

Conditions Element (Required, 1 element allowed) Sequence (Required, 1 element allowed) Condition Element (Optional, unlimited elements allowed)
Conditions Element (Optional, unlimited elements allowed)


Children

Used By

Source

<xs:element xmlns:xs="http://www.w3.org/2001/XMLSchema" name="Conditions">
    <xs:annotation>
        <xs:documentation>A collection of identification conditions.</xs:documentation>
    </xs:annotation>
    <xs:complexType>
        <xs:sequence>
            <xs:element name="Condition" minOccurs="0" maxOccurs="unbounded">
                <xs:annotation>
                    <xs:documentation>A single identification condition.</xs:documentation>
                </xs:annotation>
                <xs:complexType>
                    <xs:attribute name="prop_name" type="xs:string" use="required">
                        <xs:annotation>
                            <xs:documentation>The name of the HTML property whose value is checked in this identification condition.</xs:documentation>
                        </xs:annotation>
                    </xs:attribute>
                    <xs:attribute name="expected_value" type="xs:string" use="required">
                        <xs:annotation>
                            <xs:documentation>The expected value of the HTML property.</xs:documentation>
                        </xs:annotation>
                    </xs:attribute>
                    <xs:attribute name="is_reg_exp" type="xs:boolean" use="optional" default="false">
                        <xs:annotation>
                            <xs:documentation>Indicates whether the expected value is a regular expression. Possible values: true, false.</xs:documentation>
                        </xs:annotation>
                    </xs:attribute>
                    <xs:attribute name="equal" type="xs:boolean" use="optional" default="true">
                        <xs:annotation>
                            <xs:documentation>Indicates whether the value of the property must be equal to the specified expected value for the condition to be met. Possible values: true, false.</xs:documentation>
                        </xs:annotation>
                    </xs:attribute>
                    <xs:attribute name="trim" type="xs:boolean" use="optional" default="true">
                        <xs:annotation>
                            <xs:documentation>Indicates whether the value of the property and the expected value must be trimmed before the evaluation of the condition. Possible values: true, false.</xs:documentation>
                        </xs:annotation>
                    </xs:attribute>
                </xs:complexType>
            </xs:element>
            <xs:element ref="Conditions" minOccurs="0" maxOccurs="unbounded" />
        </xs:sequence>
        <xs:attribute name="logic" use="optional" default="and">
            <xs:annotation>
                <xs:documentation>Indicates whether to use 'and' or 'or' logic on the set of conditions in this element. Possible values: and, or.</xs:documentation>
            </xs:annotation>
            <xs:simpleType>
                <xs:restriction base="xs:string">
                    <xs:enumeration value="and" />
                    <xs:enumeration value="or" />
                </xs:restriction>
            </xs:simpleType>
        </xs:attribute>
        <xs:attribute name="type" use="optional">
            <xs:annotation>
                <xs:documentation>The type of condition. Required if the condition is not nested within another. Possible values: IdentifyIfPropMatch, CallIDFuncIfPropMatch, SkipIfPropMatch.</xs:documentation>
            </xs:annotation>
            <xs:simpleType>
                <xs:restriction base="xs:string">
                    <xs:enumeration value="CallIDFuncIfPropMatch" />
                    <xs:enumeration value="IdentifyIfPropMatch" />
                    <xs:enumeration value="SkipIfPropMatch" />
                </xs:restriction>
            </xs:simpleType>
        </xs:attribute>
    </xs:complexType>
</xs:element>