Interface FileChooser


  • 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"));
     
    • 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 the filePaths are 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 the filePaths are 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 the filePaths are 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 the filePaths are 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 the filePaths are 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 the filePaths are 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 the filePaths are 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 the filePaths are relative paths, then they are resolved relative to the current working directory. For empty array, clears the selected files.
        Since:
        v1.8