Package com.codeborne.selenide
Class DownloadOptions
java.lang.Object
com.codeborne.selenide.DownloadOptions
- All Implemented Interfaces:
HasTimeout
-
Method Summary
Modifier and TypeMethodDescriptionstatic DownloadOptions
file()
@Nullable FileDownloadMode
@Nullable Duration
@Nullable Duration
timeout()
toString()
static DownloadOptions
using
(FileDownloadMode method) withAction
(DownloadAction action) User action to start the downloading process.withExtension
(String extension) withFilter
(FileFilter filter) withIncrementTimeout
(Duration incrementTimeout) Set increment timeout for downloading.withMethod
(FileDownloadMode method) withNameMatching
(String fileNameRegex) withTimeout
(long timeoutMs) withTimeout
(Duration timeout)
-
Method Details
-
getMethod
-
timeout
- Specified by:
timeout
in interfaceHasTimeout
-
incrementTimeout
-
getFilter
-
getAction
-
withMethod
-
withTimeout
-
withTimeout
-
withIncrementTimeout
Set increment timeout for downloading. If no changes in files will be detected during this period of time, the download will be concluded as failed.Currently, it's used only for FOLDER download method. It's reasonable to set increment timeout when 1. the download timeout is quite large (download might be very slow), and 2. there is a risk that the downloading process hasn't even started (click missed the link etc.) Then setting a shorter increment timeout allows you to fail faster.
- Parameters:
incrementTimeout
- should be lesser than download timeout
-
withFilter
-
withExtension
-
withName
-
withNameMatching
-
withAction
User action to start the downloading process. By default, it's a click.Use this method if you need to close some alert before downloading file etc.
- Parameters:
action
- any lambda accepting a Driver and WebElement (the element being clicked).- Returns:
- DownloadOptions
-
toString
-
file
-
using
-