Forum Discussion

dhundley's avatar
dhundley
Regular Contributor
2 months ago

waitproperty waits the entire timeout value even after the property value is true

the description of the waitproperty method is

after clicking a Continue button on one page of my application I want to wait up to 30 seconds for the next page to appear which has another button on it that needs to be clicked. So, i've got two lines similar to what you see here to accomplish that

i've have also tried having the 30000 above as -1 and the value for [Default] on that line as 30000 and i've tried having both values set to 30000. Doesn't matter how i set them, even if the button exists right away (like within one or two seconds) it's going to wait the entire 30 second amount of time before the click operation is performed. 

i'm sure i could work around this by creating a javascript function such as this that just performs a 1 second do loop until it either exists or the 30 seconds has expired and replacing the waitproperty line in my code above with a run script routine call to the javascript function but i want to know why the method is not workings as described in the doc. can someone either duplicate what i'm getting or tell me what i've done wrong?

 

1 Reply

  • I use WaitProperty and WaitWindow regularly in scripts and haven't seen that problem.  Is there a chance it's not finding the button for some reason?  Maybe the identification properties on your button? 

    Also, if you comment out your line with the WaitProperty does it find the button when you attempt to click on it?  If should wait for whatever amount of time you have set for the autowait in that case.

    For debugging the problem I'd be tempted to use the "If statement" approach shown in this topic:  Checking Whether an Object Exists | TestComplete Documentation (smartbear.com)

    Using that method you could at least verify whether or not the WaitProperty is really finding the button at all.

    Best regards,

    John