Skip to content

image()

This selector lets you identify an image on a web page. This is done via the image’s alt text or attribute and value pairs and proximity selectors.

await click(image('alt'))
await image('alt').exists()
await image({id:'imageId'}).exists()
await image({id:'imageId'},below('text')).exists()
await image(below('text')).exists()
NameTypeDescription
attrValuePairsObjectPairs of attribute and value like {“id”:“name”,“class”:“class-name”}
_optionsObjectDefault: {}.
argsrelativeSelectorProximity selectors
altstringThe image’s alt text.
TypeDescription
ImageWrapper