Please watch the episode on Telerik TV on Image Verification
. This standard Image Verification will not work if the image changes, as it is based on image content. We have conceived a couple work-arounds, however:
- Perform an image verification on the red "X" when the image fails to load. Then, with the help of a coded step, you can tell the test to continue if the verification fails (which in this case means the real image loaded). If the verification passes (meaning the red "X" is showing and the image did not load), then the test fails.
- Craft a step entirely in code that sends a request to the image URL. If a 200 OK code is received, the step passes. If a 404 NOT FOUND code is received, the step fails.
Both of these options can be copied and slightly tweaked to meet the needs of several image elements on a single page.
For an advanced Image Comparison in code, please see this KB article
Note: While you can manually build a verification of the image element based on "IsVisible," this step will pass even if an "X" loads instead of the actual image. In this case Test Studio is simply verifying the underlying element is visible, and not verifying that the element's image is properly loading.
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>