Package com.microsoft.playwright
Interface FileChooser
- All Known Implementing Classes:
FileChooserImpl
public interface FileChooser
FileChooser objects are dispatched by the page in the Page.onFileChooser() event.
FileChooser fileChooser = page.waitForFileChooser(() -> page.getByText("Upload file").click());
fileChooser.setFiles(Paths.get("myfile.pdf"));
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionelement()Returns input element associated with this file chooser.booleanReturns whether this file chooser accepts multiple files.page()Returns page this file chooser belongs to.default voidsetFiles(FilePayload files) Sets the value of the file input this chooser is associated with.default voidsetFiles(FilePayload[] files) Sets the value of the file input this chooser is associated with.voidsetFiles(FilePayload[] files, FileChooser.SetFilesOptions options) Sets the value of the file input this chooser is associated with.voidsetFiles(FilePayload files, FileChooser.SetFilesOptions options) Sets the value of the file input this chooser is associated with.default voidSets the value of the file input this chooser is associated with.default voidSets the value of the file input this chooser is associated with.voidsetFiles(Path[] files, FileChooser.SetFilesOptions options) Sets the value of the file input this chooser is associated with.voidsetFiles(Path files, FileChooser.SetFilesOptions options) Sets the value of the file input this chooser is associated with.
-
Method Details
-
element
ElementHandle element()Returns input element associated with this file chooser.- Since:
- v1.8
-
isMultiple
boolean isMultiple()Returns whether this file chooser accepts multiple files.- Since:
- v1.8
-
page
Page page()Returns page this file chooser belongs to.- Since:
- v1.8
-
setFiles
Sets the value of the file input this chooser is associated with. If some of thefilePathsare relative paths, then they are resolved relative to the current working directory. For empty array, clears the selected files.- Since:
- v1.8
-
setFiles
Sets the value of the file input this chooser is associated with. If some of thefilePathsare relative paths, then they are resolved relative to the current working directory. For empty array, clears the selected files.- Since:
- v1.8
-
setFiles
Sets the value of the file input this chooser is associated with. If some of thefilePathsare relative paths, then they are resolved relative to the current working directory. For empty array, clears the selected files.- Since:
- v1.8
-
setFiles
Sets the value of the file input this chooser is associated with. If some of thefilePathsare relative paths, then they are resolved relative to the current working directory. For empty array, clears the selected files.- Since:
- v1.8
-
setFiles
Sets the value of the file input this chooser is associated with. If some of thefilePathsare relative paths, then they are resolved relative to the current working directory. For empty array, clears the selected files.- Since:
- v1.8
-
setFiles
Sets the value of the file input this chooser is associated with. If some of thefilePathsare relative paths, then they are resolved relative to the current working directory. For empty array, clears the selected files.- Since:
- v1.8
-
setFiles
Sets the value of the file input this chooser is associated with. If some of thefilePathsare relative paths, then they are resolved relative to the current working directory. For empty array, clears the selected files.- Since:
- v1.8
-
setFiles
Sets the value of the file input this chooser is associated with. If some of thefilePathsare relative paths, then they are resolved relative to the current working directory. For empty array, clears the selected files.- Since:
- v1.8
-