Taiko
Documentation

Home / API Reference

listItem

This selector lets you identify a list item (HTML <li> element) on a web page with label or attribute and value pairs and proximity selectors.

Examples

await highlight(listItem('Get Started'))
await listItem('Get Started').exists()
await listItem({id:'listId'}).exists()
await listItem({id:'listItemId'},below('text')).exists()
await listItem(below('text')).exists()
await listItem({id:'listItemId'},{ selectHiddenElements: true },below('text')).exists()

Parameters


label

The label of the list item.


_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

ListItemWrapper