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.
Examples
Section titled “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
Section titled “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
Section titled “Returns”| Type | Description |
|---|---|
| ImageWrapper |