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.

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
NameTypeDescription
labelOrAttrValuePairsObjectEither the label (human-visible name) of the text field or pairs of attribute and value like {“id”:“name”,“class”:“class-name”}
_optionsObject
argsrelativeSelectorProximity selectors
TypeDescription
DropDownWrapper