Forum Discussion

DanielM75's avatar
DanielM75
Occasional Contributor
5 years ago

Desktop Application Lag and BDD

Hello Everyone, two questions for you.   1. We are executing some testing in Australia connecting to a PC in the US.  Running a desktop app remotely. The scripts are unreliable - sometimes they wo...
  • tristaanogre's avatar
    5 years ago

    I'm not very good at BDD either... but the wait code.... it's alot simpler than that.

     

    So, let's say you have an object... Aliases.MyApp.MyForm.MyButton... and you want to wait for the button.  Do this.

     

    (code is pseudo JavaScript)

     

    if (Aliases.MyApp.MyForm.WaitAliasChild('MyButton', 20000).Exists) {
        Log.Message('The object existss')
        Aliases.MyApp.MyForm.MyButton.Click()
    }
    else Log.Message('The object does not exist')

    There are a variety of "wait" functions and methods built in to TestComplete which will wait for an object to exist.  If it does exist, the function actually returns the object itself.  If it does not exist, the function will return a "stub" object with one property (Exists) set to False.