This selector lets you identify a button on a web page with label or attribute and value pairs and proximity selectors.
Tags button and input with type submit, reset and button are identified using this selector
Examples
await highlight(button('Get Started'))
await button('Get Started').exists()
await button({id:'buttonId'}).exists()
await button({id:'buttonId'},below('text')).exists()
await button(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 |
label |
string |
The button label. |
Returns