Create Exist statements to identify parent object description problems

Relevant for: GUI tests and components

When you record an operation on an object, UFT One learns the object in terms of its entire parent hierarchy. Therefore, if UFT One cannot identify any one of the parent objects during a run session, it also cannot identify the object.

You can easily identify the problematic parent object by using a Msgbox with the Exist method to check each object in the hierarchy.

Suppose you receive a Cannot Identify Object message for the following statement or step, even though you have confirmed that the description of the Link object in the Object Properties dialog box matches the description in the Object Spy:

Browser("MyCompany").Page("MyCompany").Frame("Navigate").Link("Arts & Humanities").Click

Insert the following statements directly before the problematic statement:

Msgbox Browser("MyCompany").Exist 
Msgbox Browser("MyCompany").Page("MyCompany").Exist
Msgbox Browser("MyCompany").Page("MyCompany!").Frame("Navigate").Exist
Msgbox Browser("MyCompany").Page("MyCompany!").Frame("Navigate").Link("Arts & Humanities").Exist

When you run the test or component from the beginning, you find that the first and second lines run successfully and the message box for each displays True.

However, when UFT One runs the third step, it is unable to find the Frame object, and the message box displays False. This indicates a problem with the Frame test object description.

After you identify a problematic parent object description, fix the description using the suggestions for Solve object description problems.