Ask a Question

Checkpoint - Verify object disappeared without long wait time

SOLVED
ChristinaQa
Occasional Contributor

Checkpoint - Verify object disappeared without long wait time

How do you correctly verify that object does not exist? On occasions, I want to make sure that something closed, or disappeared or ceased to exist as expected. 

I can used the 'Property Checkpoint'. I can verify that the 'Exists' property of the object 'Does not equal' 'true'. I can also verify that the 'Exists' property of the object 'Equals' 'false'. However, both of these assume that you want something to exist ... so it will wait for the object to exist. Therefore, in order to figure out if that object exists or not, you have to wait a long time. There is a difference between waiting for an object to exist, and waiting for an object to disappear. When waiting for an object to exist, this means you keep checking the 'exist' property until the exist property is true OR time runs out. When waiting for an object to disappear, this means that you keep checking the 'exists' property until the exist property is false OR time runs out. 

 

Question: Is there a checkpoint configuration which will allow me to verify that an object has dissapeared?

Question: Is there a quick way to get the 'Exists' property of an object. If the object does not exist, then I have to wait 20 seconds to find out that 'Exists'  = false

3 REPLIES 3
Kitt
Regular Contributor

You could try the WaitProperty method using VisibleOnScreen property value. [TestComplete reference]

 

Something similar to [this] if you use name mapping

-OR-

Something like [this] for normal script options

[[ kITt: keep IT testing ]]
ChristinaQa
Occasional Contributor

Thanks 8Kit, I'll try this out and see how it works

MW_Didata
Contributor

You could use 'If Object' Exists/ Not Exists, then right-click 'Set Auto-Wait Timeout for Operation' and set that to 3 seconds. if within 3 seconds the object does not exist continue, other wise you could set an else command.

MW_Didata_0-1672912707056.png

In this example it checks if the object exist then based on the result it changes a Variable. it only checks for 3 senconds because wainting for 20 seconds is not needed in this case.

cancel
Showing results for 
Search instead for 
Did you mean: