Taiko
Documentation

Home / API Reference

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

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


label

The button label.


_options

_options.selectHiddenElements boolean

Option to include hidden elements.

Default value
false

attrValuePairs

Pairs of attribute and value like {"id":"name","class":"class-name"}


args relativeSelector

Proximity selectors


Returns

ElementWrapper