Interface HasDownloads

All Known Implementing Classes:
ChromeDriver, ChromiumDriver, EdgeDriver, FirefoxDriver, InternetExplorerDriver, RemoteWebDriver, SafariDriver

public interface HasDownloads
Indicates that a driver supports downloading remote files.
  • Method Details

    • requireDownloadsEnabled

      default void requireDownloadsEnabled(Capabilities capabilities)
      Requires downloads to be enabled.

      TODO: Create an example in the documentation and provide a link to it.

      capabilities - the capabilities object
      WebDriverException - if capability to enable downloads is not set
    • getDownloadableFiles

      List<String> getDownloadableFiles()
      Gets the downloadable files.
      a list of downloadable files for each key
    • downloadFile

      void downloadFile(String fileName, Path targetLocation) throws IOException
      Downloads a file to a given location.
      fileName - the name of the file to be downloaded
      targetLocation - the location where the file will be downloaded to
      IOException - if an I/O error occurs while downloading the file
    • deleteDownloadableFiles

      void deleteDownloadableFiles()
      Deletes the downloadable files.