Image Validation

Ranorex Spy, Recorder, and Studio.
Posts: 2
Joined: Wed Jun 12, 2013 11:33 am

Image Validation

Post by Firstsource » Wed Jun 12, 2013 11:37 am

I have a common application (WinForms) which is integrated with different applications.
I would like to automate the UI part of the common app. which has images with Rotate, Zoom in, and Zoom out functionalities and run the same in all applications.
But our image control size varies irrespective of the applications. When i tried to validate the image with contains or compare options using the tool, test step always get failed due to mismatch of expected and actual images. Actual image varies due to the change in image control size of the application. Do we have any other way to validate the images when image control size differs for the apps?

User avatar
Support Team
Site Admin
Site Admin
Posts: 12167
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Image Validation

Post by Support Team » Thu Jun 13, 2013 3:54 pm


Image comparison works pixel by pixel. If there were changes in size or color, the validation would fail.

You could try to resize your image by using a method called Imaging.Resize(Bitmap input, int width, int height). This re-sized image could be used for your validation. Please take a look at our API documentation.
Additionally, you might need to change the similarity to a lower value (e.g. 0.95).

Markus (T)

Posts: 87
Joined: Sun Aug 05, 2012 11:59 am
Location: Bilbao, Spain

Re: Image Validation

Post by mdgairaud » Thu Jun 13, 2013 4:42 pm

If you finally resize the image, be careful with proportions to avoid mismatches because of stretching the image.

Also, you can try to instead of validate the entire image, validate only a part of it that is unique for this image. For my image validation I use some methods depending the circumstances: cropping image, turn to B/W, check some pixels are filled...

have luck.


Posts: 2
Joined: Wed Jun 12, 2013 11:33 am

Re: Image Validation

Post by Firstsource » Tue Jun 18, 2013 7:16 am

Thanks for your input will try the solution that you mentioned see if it works for us.

Posts: 2
Joined: Fri Dec 06, 2013 3:45 am

Re: Image Validation

Post by daniel147 » Mon Dec 09, 2013 9:55 am

This image processor control SDK owns the APIs for developers to create image thumbnail, resize, crop, scale, flip, rotate and watermark source image file. Besides, if you want to apply some popular image effects to target image file, like image sharpening, image vintage effect creating, image color adjusting and image filtering, this control is also suitable.