我的程序中有以下代码行来验证元素是否为图像:
if (WebUI.verifyImagePresent(findTestObject('Co-Sponsor Sign Up/Account Information/SponsorLogo'), FailureHandling.CONTINUE_ON_FAILURE)) {
WebUI.takeScreenshot()
}
当我运行它时,它返回以下错误:
<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)
我已指定要通过图像的 xpath 定位的对象:
/html/body/div[2]/div[2]/div/div[2]/div[2]/span/a/img
我做错了什么?我需要什么来定位图像?