Katalon Analytics (beta) – Bringing new insights into test reports. Learn more!

How do I verify the presence of an image?

I have the following line of code in my program to verify that the element is an image:

if (WebUI.verifyImagePresent(findTestObject('Co-Sponsor Sign Up/Account Information/SponsorLogo'), FailureHandling.CONTINUE_ON_FAILURE)) {

When I run it, it returns the following error:

<TestCaseName>FAILED because (of) Unable to verify image present (Root cause: java.lang.IllegalArgumentException: This object don't have IMAGE_FILE property, please add it)

I have specified the object to be located by the xpath of the image: /html/body/div[2]/div[2]/div/div[2]/div[2]/span/a/img

What I am doing wrong? What do I need to locate the image by?


Sign In or Register to comment.