Taiko
Documentation

Home / API Reference

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:').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


attrValuePairs

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


_options

_options.selectHiddenElements boolean

Option to include hidden elements.

Default value
false

label

The label (human-visible name) of the drop down.


args relativeSelector

Proximity selectors


Returns

ElementWrapper