Ask a Question

Picture object does not contain any image

JustinL22
Occasional Contributor

Picture object does not contain any image

I am having an issue verifying a screenshot where I keep getting the test failing and and exception being thrown saying the picture object does not contain any image and I can't work out why. The screenshot checkpoint I am verifying is a button that changes how it looks when you hover over it with the mouse.

 

In the keyword test I have used the onscreen action hover mouse to hover over the button and you can see the button change (Have also used OCR action with hover to see if that made any difference). I have then added a region checkpoint with a screenshot of the new look of the button but every time it errors even though I can see on screen that the button has changed how it's displayed.

 

Does anyone have an idea of why I may keep getting this issue?

3 REPLIES 3
rraghvani
Trusted Contributor

Are you able to provide screenshots please?

JustinL22
Occasional Contributor

JustinL22_0-1679490645500.png

JustinL22_1-1679490699785.png

Here's the button to begin with and the button when hovering over it. When I run the steps for the screenshot checkpoint I get the following error

JustinL22_2-1679490870092.png

When checking the picture that testcomplete takes when there is an error it shows that the state of the button has changed as you can see below but yet I still get this error.

JustinL22_3-1679490943193.png

In the regions store I have the following screenshot saved for it to look for on screen so no idea why it gives me the error

JustinL22_4-1679491044767.png

 

  

rraghvani
Trusted Contributor

Here's script code the captures the back and front of a card

rraghvani_0-1679571458838.png

from the following website https://www.tutorialrepublic.com/codelab.php?topic=faq&file=css-image-swap-on-hover

 

See if you can apply the same logic to your keyword test.

cancel
Showing results for 
Search instead for 
Did you mean: