Skip to content

fileField()

This selector lets you identify a file input field on a web page either with label or with attribute and value pairs and proximity selectors.

await attach('file.txt', to(fileField('Please select a file:')))
await fileField('Please select a file:').exists()
await fileField({'id':'file'}).exists()
await fileField({id:'fileFieldId'},below('text')).exists()
await fileField(below('text')).exists()
NameTypeDescription
labelstringThe label (human-visible name) of the file input field.
_optionsObject
attrValuePairsObjectPairs of attribute and value like {“id”:“name”,“class”:“class-name”}
argsrelativeSelectorProximity selectors
TypeDescription
FileFieldWrapper