Package com.microsoft.playwright
Interface FileChooser
-
public interface FileChooserFileChooserobjects are dispatched by the page in thePage.onFileChooser()event.FileChooser fileChooser = page.waitForFileChooser(() -> page.getByText("Upload file").click()); fileChooser.setFiles(Paths.get("myfile.pdf"));
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classFileChooser.SetFilesOptions
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description ElementHandleelement()Returns input element associated with this file chooser.booleanisMultiple()Returns whether this file chooser accepts multiple files.Pagepage()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 voidsetFiles(Path files)Sets the value of the file input this chooser is associated with.default voidsetFiles(Path[] files)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.voidsetFiles(Path files, FileChooser.SetFilesOptions options)Sets the value of the file input this chooser is associated with.
-
-
-
Method Detail
-
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
default void setFiles(Path files)
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
void setFiles(Path files, FileChooser.SetFilesOptions options)
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
default void setFiles(Path[] files)
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
void setFiles(Path[] files, FileChooser.SetFilesOptions options)
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
default void setFiles(FilePayload files)
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
void setFiles(FilePayload files, FileChooser.SetFilesOptions options)
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
default void setFiles(FilePayload[] files)
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
void setFiles(FilePayload[] files, FileChooser.SetFilesOptions options)
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
-
-