Waiting for window till a given time
As we all know TC does not support a very important feature of timeout with exists function, Smartbear telling us to use some WaitNNN method, :catfrustrated: but again without exists i am not sure how to really use it ?
My situation is : after clicking on submit button, I have to wait maximum of 5 sec for error message, if no error message comes, in 5 sec it means, records are saved successfully.
Now i am doing waitNNN (waitwindow) for 5 sec, after 5 sec, i will get an window proxy object, i have check if this window object is exists or not for writing results.
Please note : this .exists takes 30 sec (which is provided in the project properties), then what is the use of WaitNNN... am super confused, begging TC to add timeout to .exits function. or comeup with .ExistsEx(timeout).
I dont understand why they (SB) are pushing this stupid WaitNNN and not listing users to imporve TC by providing a simple solution to complexity, this is very annoying.
Hi,
The difference between, for example, .Window() and .WaitWindow() is that .Window() searches for the window for the AutoWait timeout and posts a message to the log if the window was not found. You should consider this function as a kind of implicit checkpoint - i.e. if the window must be present and you reference it via the call to .Window(), you will be notified if the window did not exist without any additional actions from your side.
.WaitWindow() searches for the window for the specified timeout (for example, you may specify zero wait time in order not to wait for the window but just to check whether it exists or not) and does not post anything to the log. Then it is your responsibility to decide what to do if the window was found or not as it is only you who knows whether or not window is expected to exist or not. So no reason to post something into the log if the window was not found because it well might be that I want to check that some window does not exist. And in this case my code will be like this:
If (obj.WaitWindow().Exists) Then
Log.Error("Window that must be absent exists")
End If
...