Forum Discussion

AnneTheAgile's avatar
AnneTheAgile
Contributor
9 years ago

Click ok to pop up window OR Do not wait for it.

I cannot figure out how to programmatically understand whether an intermediate window will appear. If it does appear, it needs to be clicked 'ok'. How can I ignore it or click ok if after say 3 seconds it does not appear?

thank you!

3 Replies

  • AlexKaras's avatar
    AlexKaras
    Champion Level 3

    Hi,

     

    It might be something like this (untested VBScript pseudocode):

    Set win = Parent.WaitWindow(<class>, <caption>, -1, 3000) ' 3 sec

    If (win.Exists) Then _

      Call win.button("OK").Click

    ...

     

    Instead of WaitWindow() you may use WaitChild(), WaitAliasChild(), WaitVCLObject(), or any other WaitXXX() function depending on your tested application.

    • AnneTheAgile's avatar
      AnneTheAgile
      Contributor

      ty! I will go try and report back. I used scripts before but I have to refresh my memory.

  • cunderw's avatar
    cunderw
    Community Hero

    If you're in a KWT use the if Object operation and set it's wait timeout to three seconds. Then nest the clicking operation to the if object operation.