Forum Discussion

rushikesh's avatar
rushikesh
Contributor
6 years ago
Solved

Is there a way to know which dialog pop ups from set of dialog, after a particular action?

Hi,

 

I have a test case in which a dialog gets launched after clicking a button.

This dialog may not be same everytime. ( There is set of 5 dialogs from which a dialog is picked.)

 

I want to find out which dialog is launched after the click. So is there a way to know which object is launched ? to understand dialog name.

 

I used below code.

 

button.Click()

if(dialog1.Exists)

log.message("1dialog")

if(dialog2.Exists)

if(dialog3.Exists)

log.message("3 dialog")

if(dialog4.Exists)

log.message("4 dialog")

if(dialog5.Exists)

log.message("5 dialog")

 

This is time consuming when last dialog is launched as it will check for all dialog. 

Is there any method to know which object is launched after clicking the botton without checking every object.

   

  • You can control the amount of time it checks for each dialog by using judicious placements of "WaitChild" or "WaitAliasChild" to wait for the dialog.  Those methods have a timeout setting that you can set to a max level.  That way, rather than waiting for the global project level timeout, you can customize it based upon expected timeout for each dialog.

2 Replies

  • AlexKaras's avatar
    AlexKaras
    Champion Level 3

    Hi,

     

    > is there a way to know which object is launched ?

    No way, unless your tested application provides some info about this.

     

    • tristaanogre's avatar
      tristaanogre
      Esteemed Contributor

      You can control the amount of time it checks for each dialog by using judicious placements of "WaitChild" or "WaitAliasChild" to wait for the dialog.  Those methods have a timeout setting that you can set to a max level.  That way, rather than waiting for the global project level timeout, you can customize it based upon expected timeout for each dialog.