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.
Examples
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()
Parameters
| Name |
Type |
Description |
attrValuePairs |
Object |
Pairs of attribute and value like {“id”:“name”,“class”:“class-name”} |
_options |
Object |
Default: {}. |
args |
relativeSelector |
Proximity selectors |
alt |
string |
The image’s alt text. |
Returns