Skip to content

dropDown()

This selector lets you identify a dropDown on a web page either with label or with attribute and value pairs and proximity selectors. Any value can be selected using value or text or index of the options.

Examples

await dropDown('Vehicle:').select('Car')
await dropDown('Vehicle:').select({index:'0'}) - index starts from 0
await dropDown('Vehicle:').value()
await dropDown('Vehicle:').options() - Returns all available options from the drop down
await dropDown('Vehicle:').exists()
await dropDown({id:'dropDownId'},below('text')).exists()
await dropDown(below('text')).exists()
await dropDown('Vehicle:').select(/Car/) // Only matches drop down text and not the value

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
DropDownWrapper