TestProject Forum

Image component did not change after a test - how? [SOLVED]

Hello all,

I am using the latest version to date [18/08/2021].
I am testing a login process in a web site, comprised of two pages. I want check an image component didn’t change after I run a test.

What can I use to make this assertion ?

Hello @ittailavi
This is how you can compare images:
First, you need to prepare in advance the image of the element to which you want to compare with the UI element, for that you can use Take element screenshot:
in the action, you need to select the element, the path to save the image and the name.

After you have that image you can use it for the compering.

I chose to take the created image and create a new folder for it I called an image “expected results”
So now, I can use Compare image with UI element action:

I put the ImagePath “C:\screenshot\expected results\demo.jpg” Where I saved the Image.
ResultImagePath is “C:\screenshot” there I choose to save the path where the image to be taken in the test will be saved.
ImgName: “imageFromApp”
FileFormat “jpg”.

So now I can run it without the step that takes the first image (I put it on Disable, you can delete this step as well, you don’t need it), because I already have that Image.
Now you can look at the result of the run

You can see the step is passed, the difference is 0.00%, which means the images are completely identical!

Thank you for your answer.

I did as you said, but the after the second step [that fails], I get the following : The location of the images was not found.
However, in the first step the image is saved locally.
I tried using the same folder for both and also different ones [for both Input and ResultImagePath, that is].
What could be the problem?

Can you please share screenshots of your steps?

There you go:

Picture 1of 4

Step 10, pic1/2

Picture 2of 4

Step 10, pic2


/2

Picture 3


of 4

Step 11, pic1/2

Picture 4of 4

Step 11


, pic2/2

Please type the ImagePath as the example.
image

Now it is working, thank you for your help

1 Like