Forum Discussion
tristaanogre
14 years agoEsteemed 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:
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.
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.