Ranorex Imaging Class To Perform Visual Regression Checks
Posted: Sat Feb 24, 2018 8:42 am
Hi Team,
We are using Ranorex 7.2, and we are trying to implement image comparison to perform visual regression for our localizaion testing. As part of this, we've written following snippet using Ranorex's Imaging class (refer below code). its good and we can able to compare 2 images and report out result as boolean
But the expectations here are,
1. Ranorex should be creating difference of 2 images as Bitmap output
2. Ranorex should be able to ignore unintended regions in the given images, like date & time, usernames etc.
Could you please share any workaround to get ride off above bottlenecks ? It would be really great and useful as we need to perform visual checks for more than 25 languages for the same product (and its really time consuming manual task though)
Saravanan
We are using Ranorex 7.2, and we are trying to implement image comparison to perform visual regression for our localizaion testing. As part of this, we've written following snippet using Ranorex's Imaging class (refer below code). its good and we can able to compare 2 images and report out result as boolean
But the expectations here are,
1. Ranorex should be creating difference of 2 images as Bitmap output
2. Ranorex should be able to ignore unintended regions in the given images, like date & time, usernames etc.
Could you please share any workaround to get ride off above bottlenecks ? It would be really great and useful as we need to perform visual checks for more than 25 languages for the same product (and its really time consuming manual task though)
Bitmap baseline = Imaging.Load(ImagesPath_Baseline + @"\" + TestName + @"\" + Path.GetFileName(image)); Bitmap actual = Imaging.Load(image); // Compare Screenshots if (Imaging.Compare(baseline, actual, 1.00)) { Report.Success("Image Matched With Baseline : " + Path.GetFileName(image)); Total_MatchesFound++; } else { TestContext.WriteLine("--------------------------------------------------------------------------------"); Report.Warn("Image Mismatch Found! : " + Path.GetFileName(image)); Report.LogData(ReportLevel.Info, "Expected Image : ", baseline); Report.LogData(ReportLevel.Info, "Actual Image : ", actual); Total_MismatchesFound++; TestContext.WriteLine("--------------------------------------------------------------------------------"); }Thanks,
Saravanan