Class HtmlFileDownloader
- java.lang.Object
-
- com.axway.ats.uiengine.elements.html.HtmlFileDownloader
-
public class HtmlFileDownloader extends Object
-
-
Constructor Summary
Constructors Constructor Description HtmlFileDownloader(AbstractHtmlDriver browserDriver)
HtmlFileDownloader(org.openqa.selenium.WebDriver driverObject)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
downloadFile(String downloadUrl)
Perform the file/image download.String
downloadFileFromLink(String pageUrl, HtmlElement linkElement)
Download the file specified in the href attribute of a HtmlElementString
getDownloadDir()
int
getHTTPStatusOfLastDownloadAttempt()
Gets the HTTP status code of the last download file attemptvoid
mimicWebDriverCookieState(boolean value)
Mimic the cookie state of WebDriver (Defaults to true) This will enable you to access files that are only available when logged in.void
setDownloadDir(String downloadDir)
-
-
-
Constructor Detail
-
HtmlFileDownloader
public HtmlFileDownloader(AbstractHtmlDriver browserDriver)
-
HtmlFileDownloader
public HtmlFileDownloader(org.openqa.selenium.WebDriver driverObject)
-
-
Method Detail
-
getDownloadDir
public String getDownloadDir()
- Returns:
- The download directory where the files will be downloaded to.
-
setDownloadDir
public void setDownloadDir(String downloadDir)
- Parameters:
downloadDir
- The download directory where the files will be downloaded to.
-
downloadFileFromLink
public String downloadFileFromLink(String pageUrl, HtmlElement linkElement) throws Exception
Download the file specified in the href attribute of a HtmlElement- Parameters:
linkElement
-- Returns:
- Throws:
Exception
-
getHTTPStatusOfLastDownloadAttempt
public int getHTTPStatusOfLastDownloadAttempt()
Gets the HTTP status code of the last download file attempt- Returns:
-
mimicWebDriverCookieState
public void mimicWebDriverCookieState(boolean value)
Mimic the cookie state of WebDriver (Defaults to true) This will enable you to access files that are only available when logged in. If set to false the connection will be made as an anonymous user- Parameters:
value
-
-
downloadFile
public String downloadFile(String downloadUrl) throws IOException
Perform the file/image download.- Parameters:
downloadUrl
-- Returns:
- download file absolute path
- Throws:
IOException
FileTransferClientException
-
-