Workaround for MessageType when using Region.Check method
Hey.
I need to move away from Region.Compare to Region.Check because of some expected tolerance in pixel values and Region.Compare only has PixelTolerance and not ColorTolerance. However, Region.Check seems to throw an error by default when there is a pixel difference, and does not take any "MessageType" parameters. It seem quite weird how these two methods work, as Region.Check is referred to be a simplified version of Regions.Check, yet it has more pixel comparison features, and less control over what happens when it does detect a difference.
Is there a way I can convert/suppress that error Region.Check is generating and turn it into a Log.Warning? I need to keep the "picture" aspect of it to check the before/after results without stopping on a pixel diff.
Thanks.
I ended up doing this, which works but it just feels really stupid that 2 core Test Complete functions that are seemingly the same take different arguments.
- Change playback options so tests don't stop on error
- Create a new onError handler
- Inside this, stop the execution for the current test only
function GeneralEvents_OnLogError(Sender, LogParams) {
if (!LogParams.MessageText.includes('The region checkpoint')) {
Runner.Stop(true)
}
}