Hello,
I've modified your code in order to reproduce a possible problem:
Bitmap image;
image = Imaging.CaptureImage (TestForKimRepository.Instance.FormVIP_Database.ButtonAdd);
image.Save (@"c:\temp\TC611.png",System.Drawing.Imaging.ImageFormat.Png);
image = Imaging.Load (@"c:\temp\TC611.png");
Validate.ContainsImage(TestForKimRepository.Instance.FormVIP_Database.ButtonAddInfo,
image,
Imaging.FindOptions.Default,
"TC611: Validation: file",
false);
My modified version works. So there shouldn't be any principle problem.
ElementN59648 creates an adapter which means that your desktop is searched for the element. With ElementN59648Info later your desktop is searched again and a new adapter is created. Could you try something like this
Bitmap image;
Ranorex.Core.Element el = repo.FormWinstn2.ElementN59648;
image = Imaging.CaptureImage (el);
image.Save (RestoreDB.SSDir+"TC611.png",System.Drawing.Imaging.ImageFormat.Png);
image = Imaging.Load (RestoreDB.SSDir+"TC611.png");
Validate.ContainsImage(el,
image,
Imaging.FindOptions.Default,
"TC611: Validation: file",
false);
Next thing to try would be the FindOptions tuning (e.g. Similarity).
It could be that the successive screenshots are not completely identical.
Regards,
Roland
Ranorex Support Team