VerifyScreenCompareEdgeBased
void VerifyScreenCompareEdgeBased(string ctrl,float tolerance = 0.04,
int blurRadius = 2,
int edgeBlurRadius = 2)
Description
Compares the current visual appearance of the specified control with its reference image using a robust edge-based comparison algorithm.
This method focuses on visual structure rather than pixel-perfect color accuracy. It is more tolerant to anti-aliasing, slight rendering shifts, compression artifacts, and sub-pixel differences.
Parameters
- ctrl - The control to compare.
- tolerance - (optional) Maximum allowed structural edge difference between the current and reference image (default = 0.04).
- blurRadius - (optional) Pre-blur radius applied before edge detection to reduce noise and anti-aliasing effects (default = 2).
- edgeBlurRadius - (optional) Post-processing blur radius applied to the edge map to increase tolerance against minor pixel shifts and rendering variations (default = 2).
Example
void main()
{
VerifyScreenCompareEdgeBased("BUTTON_OK");
VerifyScreenCompareEdgeBased("MAIN_WINDOW", 0.05, 3, 3);
}