// Get screenshot image of repo item CompressedImage img1 = myItemInfo.Getscreenshot_1(); CompressedImage img2 = myItemInfo.Getscreenshot_2(); CompressedImage img3 = myItemInfo.Getscreenshot_3(); bool res1 = Validate.ContainsImage(myItemInfo, img1, Imaging.FindOptions.Default, "Validate with img1", false); bool res2 = Validate.ContainsImage(myItemInfo, img2, Imaging.FindOptions.Default, "Validate with img2", false); bool res3 = Validate.ContainsImage(myItemInfo, img3, Imaging.FindOptions.Default, "Validate with img3", false); //bool res4 = Validate.Exists(myItemInfo, "Validate item exist", false); //bool res5 = Validate.AreEqual(1+1, 2, "Validating...", false); if (res1 || res2 || res3) Report.Log(ReportLevel.Success, "Validation", "Current item is in state1/state2/state3"); else Report.Failure("Validation", "Current item is not in any expected state");I want this module step success when myItemInfo match either img1, img2 or img3, and the module failure only when it doesn't match any expected image.
In the code above, I tried to set exceptionOnFail to false in each validation, and yes, it does not throw any exception. But I'd like my module run as success, too, and this is in the report:
Code: Select all
Success Validation Validate with img1 Failure Validation Validate with img2 Failure Validation Validate with img3 Success Validation Current item is in state1/state2/state3 Error Module The module has failed because one or more actions have failed.
So, how to solve my problem here?
PS, I would like it to work with other validation method as well, example Validate.Exist, Validate.AreEqual, ...
I wonder that there is some method like ValidateCore.ContainsImage, ValidateCore.Exist,.. that execute validation only and do not 'touch' to current module execution. Does such method exist?