Hi Jacqui,
Please try the following code snippet:
if(!Regions["Compare"]("P5414 Verify dragging to the left.bmp", Sys["Process"]("progeny")["Window"]("Afx:00400000:0", "Progeny", 1)["Window"]("AfxOleControl90", "", 1), true))
Log["Error"]("P5414 Verify dragging to the left.bmp regions are not identical.");
Does it help?
Also, if you need to use a helper variable that specifies whether the
Regions.Compare method uses transparent colors or not when performing the comparison, you can declare this variable and assign the needed boolean value to it before calling the Compare method or when passing the variable through the method's parameters. For example:
var transparent = true;
if(!Regions["Compare"]("P5414 Verify dragging to the left.bmp", Sys["Process"]("progeny")["Window"]("Afx:00400000:0", "Progeny", 1)["Window"]("AfxOleControl90", "", 1), transparent))
Log["Error"]("P5414 Verify dragging to the left.bmp regions are not identical.");
// -- or --
if(!Regions["Compare"]("P5414 Verify dragging to the left.bmp", Sys["Process"]("progeny")["Window"]("Afx:00400000:0", "Progeny", 1)["Window"]("AfxOleControl90", "", 1), transparent = true))
Log["Error"]("P5414 Verify dragging to the left.bmp regions are not identical.");
BTW, please note that the Regions.Compare method posts an appropriate message with results of the image comparison to the test log by default. The type of the message to be posted to the test log if the comparison fails is specified by the last parameter of the method,
MessageType (by default, it specifies the
warning message type). Thus, there is actually no need to check results of the Compare method and post error messages to the test log by yourself.