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.

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

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

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

      void deleteDownloadableFiles()
      Deletes the downloadable files.