Skip to content

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.

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()
NameTypeDescription
attrValuePairsObjectPairs of attribute and value like {“id”:“name”,“class”:“class-name”}
_optionsObjectDefault: {}.
argsrelativeSelectorProximity selectors
labelstringThe label of the list item.
TypeDescription
ListItemWrapper