TestProject Forum

Color verification for icons

There are two glass icons that we need to verify if they reflect on the another page .
Android Mobile testing-Please let me know solution to verify the icons
One question:Can we consider icon as image?

Hello @tanvi.lohakare
You can use Image Comparison for that.
This is how you will compare images:
First, we need to prepare in advance the image of the element to which we want to compare in our test, for that we use Take element screenshot:
in the action, we need to select the element, the path to save the image, and the name.

After we have that image we 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 saves the image (I put it on Disable), because I already have that Image.
Now you can look at the result of the run

I can see now the step is passed, the difference is 0.00%, this means that the pictures are completely identical!

Another thing you can do is use Get Color action on that element and do a verification that this is the color that should be.

Let me know if you were able to do that.