Forum Discussion

ronrhe's avatar
ronrhe
Contributor
14 years ago

how to auto-wait for a propertycheckpoint

Hi,



How do i use auto-wait in the next line :



  aqObject.CheckProperty(Aliases.SetupSimaPro733.WizardForm.OuterNotebook.FinishedPage.FinishedHeadingLabel, 'WndCaption', 6, 'voltooid', false);



I can put in an auto-wait in keyword test. But when converting to script there is no auto wait.

The docs and video doesn't reveal how to use auto-wait in a (property)check



regards

Ronald

1 Reply

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor
    Auto-wait is built into the script environment under Tools | Current Project Properties | Project | Playback.  There is an option there that sets the global auto-wait time when TestComplete needs to detect an object.  Unless otherwise specified using "WaitNNN" methods in code, that is the value that is used.   Keyword testing uses this value as well but you can over-ride it on a per operation basis.  As mentioned, the equivalent in code is to use a "Wait" method... in your case, I'd use "WaitAliasChild".  Your code would then look something like the following:



    TestObj := Aliases.SetupSimaPro733.WizardForm.OuterNotebook.FinishedPage.WaitAliasChild('FinishedHeadingLabel', 30000);

    if TestObj.Exists then aqObject.CheckProperty(TestObj, 'WndCaption', 6, 'voltooid', false);




    To adjust the timing, just change what I have as 30000 to whatever value (in milliseconds) you want to wait.



    Note that the WaitAliasChild call that I'm using assumes that the other objects in the hierarchy (SetupSimaPro733, WizardForm, OuterNotebook, and FinishedPage) have already been verified as existing or, at least, have a reasonable expectation that they will exist at this point in code.  Otherwise, they are also subject to the default wait setting.  If you need to adjust those, you will need to have additional "WaitAliasChild" calls for each level that you need to check.