Welcome to the UFT Testing Extensibility API Reference > UFT Extensibility Agent library 1.3 > Interfaces > ITestable3 Interface > Methods > FindObjectId Method
UFT Extensibility Agent library 1.3
FindObjectId Method
The Description xml of the object for which the ID is sought.

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.

Description
Returns the object ID of the child of the specified parent that matches the description.
Syntax
Visual Basic
Public Function FindObjectId( _
   ByVal descriptionXml As String, _
   ByVal externalParent As String _
) As Variant
Parameters
descriptionXml
The Description xml of the object for which the ID is sought.
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.

Return Type

The object ID and the HRESULT S_OK if found, otherwise the HRESULT E_OBJNOTFOUND.

If more than one object fits the description, returns the HRESULT E_OJBNOTUNIQUE and an empty SAFEARRY.

Remarks
  • 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.
  • In the following situations, implement FindObjectID2 instead of this method:
    • If you want to support Smart Identification, enabling UFT to single out the correct object when more than one object matches the description.
    • If you implement the ITestable3 interface to support adding test-object-related information to the run results. In this case, UFT calls FindObjectID2 instead of FindObjectID. Therefore you must implement FindObjectID2, even if you do not need to support Smart Identification. 
See Also