Validation Failure of screenshot

Ask general questions here.
Sandra
Posts: 4
Joined: Mon Oct 17, 2016 10:21 am

Validation Failure of screenshot

Post by Sandra » Mon Oct 17, 2016 10:57 am

Hello,
My test environment is Win 7 Enterprise 64 bit Service Pack 1. Ranorex version 5.4.6.
I am trying to validate an image but it is failing to validate. The code is;
void ITestModule.Run()
        {
            Mouse.DefaultMoveTime = 300;
            Keyboard.DefaultKeyPressTime = 100;
            Delay.SpeedFactor = 1.0;

            Init();

            Report.Log(ReportLevel.Info, "Mouse", "Mouse Left Click item 'Window1' at CenterRight.", repo.Window1.SelfInfo, new RecordItemIndex(0));
            repo.Window1.Self.Click("CenterRight");
            Delay.Milliseconds(0);
            
            Report.Log(ReportLevel.Info, "Validation", "Validating ContainsImage (Screenshot: 'Screenshot4' with region {X=705,Y=240,Width=194,Height=194}) on item 'Window1.DdDisplayPanel'.", repo.Window1.DdDisplayPanelInfo, new RecordItemIndex(1));
            Validate.ContainsImage(repo.Window1.DdDisplayPanelInfo, DdDisplayPanel_Screenshot4, DdDisplayPanel_Screenshot4_Options);
            Delay.Milliseconds(100);
            
        }
But it fails each time saying that the screen shot does not contain the image. But in the log file, I can clearly see the image in each screen shot.
I edited the settings by going to Settings, Imaging and selected Edges, Edges Sobel, Grayscale and I changed the similarity to 0.99 but these changes didn't seem to make a difference to the validation outcome.

The log file is attached;
images_GSWorksTestSuite_20161017_095424.zip
Thank you.

Edit by Ranorex Support: Formatted Code
You do not have the required permissions to view the files attached to this post.

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Validation Failure of screenshot

Post by Support Team » Wed Oct 19, 2016 1:31 pm

Hi Sandra,

First of all I'd like to mention that Ranorex 5.4.6 is already outdated and not supported anymore. It is highly recommended using a supported version (6.0.2 / 6.1.1).

Secondly, please upload your Ranorex report in the Rxzlog-format. The achieve you have uploaded only contains screenshots.

Additionally, may I ask you if you already had the chance to take a look on our blog posting about Enhanced Features of Image Validation. This posting describes some additional settings which can be helpful in debugging image based errors.

Hope that helps :)

Regards,
Markus (s)

Sandra
Posts: 4
Joined: Mon Oct 17, 2016 10:21 am

Re: Validation Failure of screenshot

Post by Sandra » Wed Oct 19, 2016 4:11 pm

Hello,

I only started using Ranorex in March. I wasn't aware the version was out of date already.
When I go to upload the report, I get a message saying "The extension rxzlog is not allowed". How do I post the report?
Could the validation be failing because the screenshot is not the same size as the repository item?

Thank you,
Sandra.

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 7470
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Validation Failure of screenshot

Post by odklizec » Thu Oct 20, 2016 7:44 am

Hi Sandra,

You can rename "rxzlog" extension to "zip", then it should be possible to upload it without a problem.

As for the different size of screenshot for image validation, yes, this is an issue! Validated image must have the same size as the reference one, otherwise the image validation will fail!
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

Sandra
Posts: 4
Joined: Mon Oct 17, 2016 10:21 am

Re: Validation Failure of screenshot

Post by Sandra » Thu Oct 20, 2016 9:21 am

Report log is attached.
You do not have the required permissions to view the files attached to this post.

Sandra
Posts: 4
Joined: Mon Oct 17, 2016 10:21 am

Re: Validation Failure of screenshot

Post by Sandra » Thu Oct 20, 2016 10:06 am

Thanks for the replies. I have solved the issue by re-sizing the screenshot image.