Micro Focus QTP (UFT) Forums
Checkpoint: Image [QTP 10.0] - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: Checkpoint: Image [QTP 10.0] (/Thread-Checkpoint-Image-QTP-10-0)



Checkpoint: Image [QTP 10.0] - Helen99 - 09-15-2010

Dear all,

I am able to check when an image is displayed and the check fails if it's not displayed.

But I don't know how to put a checkpoint for the absence of an image - if image is not displayed the check should pass. Is it possible? Thanks in advance for any kind of suggestion.

Kind regards,
Helen


RE: Checkpoint: Image [QTP 10.0] - rajpes - 07-19-2011

You can use visible property.


RE: Checkpoint: Image [QTP 10.0] - tdevick - 07-19-2011

Code:
result=Browser("Automation Site | Home").Page("Automation Site | Send").Image("banner").Check(CheckPoint("banner"))  
If not result Then
    'image was not matched
End If

To get the above code, I just added a checkpoint the usual way then added parenthesis after ".Check:" and after ("banner"), then assigned the result from the checkpoint to a local variable named "result".

By default, the checkpoint timeout is 0 seconds, meaning don't wait before the image appears. Just check to see if the image is there right now. Actually, it doesn't just check to see if the image exists; it also checks to see if the image is identical to the one originally captured.

In the properties for the checkpoint in your object repository, you can set the timeout - the amount of time to wait before giving up on finding the image.