Skip to content

textBox()

This selector lets you identify a text field(input (with type text, password, url, search, number, email, tel), textarea and contenteditable fields) on a web page either with label or with attribute and value pairs and proximity selectors.

Examples

await focus(textBox('Username:'))
await textBox('Username:').exists()
await textBox({id:'textBoxId'},below('text')).exists()
await textBox(below('text')).exists()

Parameters

Name Type Description
labelOrAttrValuePairs Object Either the label (human-visible name) of the text field or pairs of attribute and value like {“id”:“name”,“class”:“class-name”}
_options Object
args relativeSelector Proximity selectors

Returns

Type Description
TextBoxWrapper