Forum Discussion

googleid_116641's avatar
googleid_116641
Occasional Contributor
13 years ago

One Object for two Windows

HI All



Greetings



I am facing a trouble while automating a project



Problem is



There is a message box containing button Yes and No  , lets say this message box is mapped to object A



Clicking onto Yes button pops up another dialog containing ok button , this new box is also mapped to object A



so at the same time , both the boxes are visible on screen and mapped to one common object , so whenever i try to perform click operation onto the Ok button , testcomplete engine tries to locate ok button in the another form  which contains Yes and no button and therefore it doesnt finds that ok button and the project exectuion fails , 



Please help me to solving this problem ,



Thanks in advance

  • AlexKaras's avatar
    AlexKaras
    Icon for Champion Level 3 rankChampion Level 3
    Hi,



    You must look for the properties that are different for those two message boxes and use this difference to make it possible for TestComplete to distinguish them.

    For example, you may require existance of two children (those Yes and No buttons) for the object A. This should make TestComplete to fail to match the second message box to object A (as it contains only one button) and successfully match it to object B that you create for it.

    More information about conditional namemapping: http://support.smartbear.com/viewarticle/28807/

    More information about specifying required child objects: http://support.smartbear.com/viewarticle/30311/
  • vajindarladdad's avatar
    vajindarladdad
    Frequent Contributor
    Hi Prashant,

    The index for these 2 objects will be different. Please , map these messageBoxes using selected properly of index or something related to that.



    I hope this has been of some help.