Reputation: 704
I am using selenium IDE 1.10.0
. I am trying to check presence of image in product categories. what command should i use to verify image?
Upvotes: 2
Views: 14175
Reputation: 4981
There are 3 ways of doing that depending on your task (why you need this image):
1) you may wait for the image to perform some actions (e.g. wait for the button to click it): waitForElementPresent(locator). It uses timeout set in your Selenium IDE. So when element appears, your script will execute next line. If it does not appear - this case should be processed somehow (e.g. using verify - see item 2)
2) if you need to know if image is there - you may use verifyElementPresent(locator) - it returns true or false (and you may store this value). If image is not present - test will continue running (this is important!)
3) if this image is critical - use what was suggested here already: assertElementPresent(locator) - if image is not there test will stop.
P.s. I hope you know what locator means. If not - find samples, it is easy
Upvotes: 1
Reputation: 4318
Open selenium IDE in FF browser
Right click on the image, then you see assertelementpresent
command, if you do not see this command then hover over Show all available command and select assertelementpresent
Check image
Upvotes: 5
Reputation: 14738
try using
assertElementPresent //img
The second is xpath relative to image
Best way how to find out for yourself:
Upvotes: 1