FileChooser class
FileChooser objects are returned via the 'page.waitForFileChooser'
method.
File choosers let you react to the page requesting for a file.
An example of using FileChooser:
var futureFileChooser = page.waitForFileChooser();
// some button that triggers file selection
await page.click('#upload-file-button');
var fileChooser = await futureFileChooser;
await fileChooser.accept([File('myfile.pdf')]);
NOTE In browsers, only one file chooser can be opened at a time. All file choosers must be accepted or canceled. Not doing so will prevent subsequent file choosers from appearing.
Constructors
- FileChooser(DevTools devTools, ElementHandle element, FileChooserOpenedEvent event)
Properties
- devTools → DevTools
-
final
- element → ElementHandle
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- isMultiple → bool
-
Whether file chooser allow for multiple
file selection.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
accept(
List< File> files) → Future<void> - Accept the file chooser request with given files.
-
cancel(
) → Future< void> - Closes the file chooser without selecting any files.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited