public interface FileChooser
FileChooser objects are dispatched by the page in the Page.onFileChooser() event.
FileChooser fileChooser = page.waitForFileChooser(() -> page.click("upload"));
fileChooser.setFiles(Paths.get("myfile.pdf"));
| Modifier and Type | Interface and Description |
|---|---|
static class |
FileChooser.SetFilesOptions |
| Modifier and Type | Method and Description |
|---|---|
ElementHandle |
element()
Returns input element associated with this file chooser.
|
boolean |
isMultiple()
Returns whether this file chooser accepts multiple files.
|
Page |
page()
Returns page this file chooser belongs to.
|
default void |
setFiles(FilePayload files)
Sets the value of the file input this chooser is associated with.
|
default void |
setFiles(FilePayload[] files)
Sets the value of the file input this chooser is associated with.
|
void |
setFiles(FilePayload[] files,
FileChooser.SetFilesOptions options)
Sets the value of the file input this chooser is associated with.
|
void |
setFiles(FilePayload files,
FileChooser.SetFilesOptions options)
Sets the value of the file input this chooser is associated with.
|
default void |
setFiles(Path files)
Sets the value of the file input this chooser is associated with.
|
default void |
setFiles(Path[] files)
Sets the value of the file input this chooser is associated with.
|
void |
setFiles(Path[] files,
FileChooser.SetFilesOptions options)
Sets the value of the file input this chooser is associated with.
|
void |
setFiles(Path files,
FileChooser.SetFilesOptions options)
Sets the value of the file input this chooser is associated with.
|
ElementHandle element()
boolean isMultiple()
Page page()
default void setFiles(Path files)
filePaths are relative paths, then
they are resolved relative to the the current working directory. For empty array, clears the selected files.void setFiles(Path files, FileChooser.SetFilesOptions options)
filePaths are relative paths, then
they are resolved relative to the the current working directory. For empty array, clears the selected files.default void setFiles(Path[] files)
filePaths are relative paths, then
they are resolved relative to the the current working directory. For empty array, clears the selected files.void setFiles(Path[] files, FileChooser.SetFilesOptions options)
filePaths are relative paths, then
they are resolved relative to the the current working directory. For empty array, clears the selected files.default void setFiles(FilePayload files)
filePaths are relative paths, then
they are resolved relative to the the current working directory. For empty array, clears the selected files.void setFiles(FilePayload files, FileChooser.SetFilesOptions options)
filePaths are relative paths, then
they are resolved relative to the the current working directory. For empty array, clears the selected files.default void setFiles(FilePayload[] files)
filePaths are relative paths, then
they are resolved relative to the the current working directory. For empty array, clears the selected files.void setFiles(FilePayload[] files, FileChooser.SetFilesOptions options)
filePaths are relative paths, then
they are resolved relative to the the current working directory. For empty array, clears the selected files.Copyright © 2021. All rights reserved.