Page 1 of 2

Image validation not working properly

Posted: Fri Feb 10, 2017 11:22 am
by rastek
I see Image validation not working properly I tr'ed Contains and Compare methods and even if I do threshold %25 it fails. When I try recapture it says no need already same, so why does it fail ? I see in fail report both images are same bot somehow it failing even for very low similarity thresholds, I also used grayscale option.

For mouse actions,Image based method is working but for validation it is not.

And one more question, I change similarity but everytime it goes back to its original value 1.0, anything known about this issue ?

Re: Image validation not working properly

Posted: Fri Feb 10, 2017 12:29 pm
by odklizec
Hi,

I'm afraid, it's pretty hard (impossible) to tell what's wrong without seeing the actual report (error message) and your project. Ideally, please create a small test project, using for example Ranorex web.

The most common source of image validation problems is different screen resolution on target machine. Are you sure the screen resolution is the same both for recording and actual test environment?

Also, what you can try is to enable enhanced image validation options (Report Difference Images and/or Report Similarity), as described here. These should help you to identify the differences in your images.

BTW, keep the area of image validation as small as possible. It's not a very good idea to validate entire screen ;)

Re: Image validation not working properly

Posted: Fri Feb 10, 2017 1:54 pm
by Stub
As odklizec has mentioned, I also found that if I enabled the difference images and similarity outputs I gained a lot of understanding as to why my own image comparisons were failing.

I also applied a clipping rect so I only check the size of the expected image in case there was some slight window size differences.

Plus I only compare the specific repository item I'm interested in - eliminating scrollbars from the image helped me a lot in my early Ranorex days, though I am noting much improved success now I'm more in control.

Re: Image validation not working properly

Posted: Fri Feb 10, 2017 2:16 pm
by rastek
Resolution and everything is same on same pc , I can not send project because its Java inside Xming (thats why I want to use Image Validation) but I can send fail report.

I really hard to understand case here, I see images are same on report but its failing.

Re: Image validation not working properly

Posted: Fri Feb 10, 2017 2:30 pm
by odklizec
This is a problem of image validation done by human. The images may look the same, but they are most probably not ;)

Have you tried the validation options I mentioned in my previous post?

Re: Image validation not working properly

Posted: Fri Feb 10, 2017 5:43 pm
by rastek
odklizec

I enabled similariy reporting and it says

Screenshot of item 'omniRepository.U1037U1037.Client' does not contain the specified image (similarity actual='0.992091393258288', expected='1').


It says it is 0.99 however I did it 0.50 so what is wrong here , where does 1 come from ??

I took the record, reduce similarity to %50 and play immediately after record. Only check contains validation and take an area which is not definitely change, but still fails..

Re: Image validation not working properly

Posted: Fri Feb 10, 2017 8:01 pm
by odklizec
Just to be sure, what version of Ranorex are you using? I believe you were using 6.0 or something like this? Please make sure you are using the latest 6.2.1.

Re: Image validation not working properly

Posted: Sun Feb 12, 2017 2:15 pm
by rastek
I am using 5.4.5 and handled for another page hope will work on previous too.

Re: Image validation not working properly

Posted: Sun Feb 12, 2017 6:22 pm
by odklizec
Hi,

I'm afraid,5.4.5 is too old and no longer supported. I believe the Image validation worked for me in 5.4.5, but even if there is a bug, there is no chance there will be released another 5.x.x service release. It's simply an outdated version. So please try your problem with most recent 6.2.1 and see if it works there.

Re: Image validation not working properly

Posted: Mon Feb 13, 2017 9:24 am
by Stub
Enabling the difference image option will be quite revealing as it graphically shows which parts of the two images are slightly different - not just giving a number between 0 and 1 (100% identical). Very useful.

Re: Image validation not working properly

Posted: Wed Feb 15, 2017 2:11 pm
by rastek
I see that it is not working, especially if you are running from Test Suite (rxtst file) and I Still dont understand where that 1 comes from ? İt says expected value is 1, however it is 80% .. ??

Is there a Test Case or Test Suite level Imaging similarity threshold ?

I see it is same 80% in global settings, so where does that 1 come from..

Module execution was aborted because a validation step has failed. Screenshot of item 'asplatformRepository.ApplicationServerInstallWizar.ApplicationServerInstallWizar' does not contain the specified image (similarity actual='0.99997038007423', expected='1').

Re: Image validation not working properly

Posted: Wed Feb 15, 2017 2:31 pm
by odklizec
Hi,

In my opinion, your problem is most probably caused by the fact, that the validated image is not entirely loaded during the validation? Have you tried to enable the suggested option "Report Difference Images"? This should tell you what exactly is different during the validation. And once again, 5.4.x is outdated and no longer supported. Please TRY to reproduce your problem with latest 6.2.1. You may be chasing a long time dead dog ;)

Re: Image validation not working properly

Posted: Wed Feb 15, 2017 2:48 pm
by rastek
odklizec I tried it already, when I enable Report Difference Images" test result report does not come up et all..

Actually I put 1 second before image validation and in reports I see that comparision is done with correct image.
I am downloading version 6.2, before I see some plugin problems with 6.1 thats why I have not transfer to that version but I do not understand this solution that whenever encounter a problem you tell to go latest version.

By the way, report says similarity level is 0.99 but expected='1' so I do not think comparision is done with another image, I put delay and I see screen totally loaded before validation action starts..

Re: Image validation not working properly

Posted: Wed Feb 15, 2017 3:08 pm
by odklizec
They reason why we (not just me, but anyone posting at this forum) are always suggesting to try the problem with latest version is simple. The problem you are experiencing may already be fixed in most recent version ;) The version (5.4.5) you are currently using has been released in January 2016...it's over a year old! It's not only old, but also no longer supported by Ranorex. So even if there is bug in your version and the bug is reproducible in 6.x version, Ranorex will most certainly fix it in 6.x.x and not 5.x.x. So it's a waste of time and energy to explore a potential bug in such old version, not to mention most people here are using most recent version, or at worst previous version. So we are not compatible with you anymore ;)

Re: Image validation not working properly

Posted: Wed Feb 15, 2017 7:23 pm
by rastek
Yeah I Understand you and tried with 6.2.1 and got same error at same recordings.
Actually Ranorex produce actual and expected images even if you do not enable that feature ..


By the way my real question still not answered, why I see expected 1 even though I make it 80 percent ??

actual='0.999673567309277', expected='1' actual='0.999673567309277', expected='1'