Forum Discussion

albertopasion's avatar
albertopasion
Occasional Contributor
14 years ago

object does not exist

I have a Delphi App that creates TPanels on the fly.  The specific form, makes a TPanel visible after clicking a particular button. In that TPanel are several TButtons that need to be clicked or pressed. 


I was recording the script to test this specific form.  But when running the back the script, I always get the message waiting for Object.  Then I get Object Does not Exist.  The script terminates after receiving the said message.


Under the debugger, if you try to query for the existence of the that TPanel and those TButtons, the exist property for all of them is set to false, yet they are all visible and you can manually click on the said TButtons.  TestComplete is not able to perform a ClickButton because it cannot find the object.


How are we suppose to handle this?


Thank you in advance. 


Albert

2 Replies

  • Hi Albert,


    I suppose the dynamically created panels do not have properties which can be used to identify them uniquely, and therefore, TestComplete can retrieve children of a wrong panel accidentally. To avoid the problem, I recommend that you look for the specific objects you need to click using unique properties of these objects (for example, their native names or text). To find an object regardless of its position in the hierarchy, you can use the FindChild method or, if you are using Name Mapping, the Extended Find feature.
     

  • I cann't understand why PEOPLE think that when they record some script They cann't guess that ALSO need edit namemappeng =(