Package org.openqa.selenium
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 Summary
Modifier and TypeMethodDescriptionvoidDeletes the downloadable files.voiddownloadFile(String fileName, Path targetLocation) Downloads a file to a given location.Gets the downloadable files.default voidrequireDownloadsEnabled(Capabilities capabilities) Requires downloads to be enabled.
-
Method Details
-
requireDownloadsEnabled
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
Gets the downloadable files.- Returns:
- a list of downloadable files for each key
-
downloadFile
Downloads a file to a given location.- Parameters:
fileName- the name of the file to be downloadedtargetLocation- 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.
-