Skip to content

button()

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

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()
NameTypeDescription
attrValuePairsObjectPairs of attribute and value like {“id”:“name”,“class”:“class-name”}
_optionsObjectDefault: {}.
argsrelativeSelectorProximity selectors
labelstringThe button label.
TypeDescription
ButtonWrapper