ITestable2 Interface : FindObjectId2 Method |
The ExternalParent xml of the Windows application object hosting the test object.
For a stand-alone application or a case where the external parent is not relevant to the testing environment, NULL is passed.
Visual Basic |
---|
Public Function FindObjectId2( _ ByVal descriptionXml As String, _ ByVal externalParent As String _ ) As Variant() |
- descriptionXml
- The Description xml of the object for which the ID is sought. The description may include regular expressions.
- externalParent
The ExternalParent xml of the Windows application object hosting the test object.
For a stand-alone application or a case where the external parent is not relevant to the testing environment, NULL is passed.
A SAFEARRAY containing the object IDs if found, and the HRESULT S_OK.
If no object matches the description, returns the HRESULT E_OBJNOTFOUND and an empty SAFEARRY.
- It is possible to have a non-unique description if a user builds a description manually and uses it in a test, if the application being tested changes during the run, or if the user manually changes properties of the object in the Object Repository.
Returning more than one object ID enables UFT One to use Smart Identification (if configured) to single out the correct object when more than one object matches the description.
Return object IDs even if the object is not visible. - If you Implement the ITestable3 interface UFT One calls this method instead of FindObjectId. Therefore, you must implement this method even if you do not need to support Smart Identification.