| || |
usage of exists....
I want to add some pause in my test. I am using wait but it is not efficient. I read in user guide that I can use exists but still not clear from its example. I am looking for something similar to win_exists of WR. Let me know if there is a sample code for that.
Re: usage of exists....
Most often, but certainly not always, just confirming that an object "exists" is not adequate for more most "bullet proof" coding.
<page or window>.control("blah").Exist(5) will wait up to 5 seconds for the control to exist (returning True as soon as the object comes into existance or False after 5 seconds).
But the control might exist but not yet be ready for input. Therefore what we often want to do is "sync" to "some state" of an object before proceeding. In this second scenario check to see if the object you want to work with in QTP supports a <object>.sync() method (for example the Browser and browser Page objects do). When an object does not support a .sync method then use one of the object's <object>.WaitProperty(<property_name>, <property_state> method to customize what you sync to.
Check online help for more details on these comments.
-Hope this helps, Terry