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.

Examples

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()

Parameters

Name Type Description
label string The label (human-visible name) of the file input field.
_options Object
attrValuePairs Object Pairs of attribute and value like {“id”:“name”,“class”:“class-name”}
args relativeSelector Proximity selectors

Returns

Type Description
FileFieldWrapper