Package de.frankmuenster.mahoe.web
Class AbstractSeleniumWebSite<I extends WebAccountInformation,M extends AbstractBankMessages<org.openqa.selenium.WebDriver,I>>
java.lang.Object
de.frankmuenster.mahoe.web.AbstractWebSite<org.openqa.selenium.WebDriver,I,M>
de.frankmuenster.mahoe.web.AbstractSeleniumWebSite<I,M>
- Type Parameters:
I
- the concrete WebAccountInformationM
- the concrete AbstractBankMessages
- All Implemented Interfaces:
WebSite<I>
- Direct Known Subclasses:
BosWebSite
,SantanderWebSite
,TargoBankWebSite
public abstract class AbstractSeleniumWebSite<I extends WebAccountInformation,M extends AbstractBankMessages<org.openqa.selenium.WebDriver,I>>
extends AbstractWebSite<org.openqa.selenium.WebDriver,I,M>
Abstract class for Selenium based WebSite to provide the driver and a temp
download folder.
- Since:
- 2.0
- Author:
- Frank Münster
-
Field Summary
Fields inherited from class de.frankmuenster.mahoe.web.AbstractWebSite
accountInfo, NON_BREAK_SPACE, TABLE_TAG, webClient
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
AbstractSeleniumWebSite
(de.willuhn.jameica.hbci.rmi.Konto konto) Standardkonstruktor -
Method Summary
Modifier and TypeMethodDescriptionprotected void
checkSeleniumDriverSet
(org.openqa.selenium.WebDriver driver) Checks if the driver is set and active. if not a status bar message is send that driver is not configured.protected boolean
elementExits
(org.openqa.selenium.By byId) checks if an element identified byBy
exitsstatic byte[]
getAccountSheetAsByteArray
(org.apache.commons.lang3.tuple.Pair<Date, ?> document, org.openqa.selenium.WebDriver webClient) Returns the account sheet as byte array.static Path
Returns the temporary folder to use for downloading account sheets.protected org.openqa.selenium.WebDriver
Here we setup the Selenium driver as replacement for the HTMLUnit client.void
saveCookies
(String backupFileName) Save the cookies to be used next timestatic void
shutDown()
Clean and remove temp-folder and shutdown the driverMethods inherited from class de.frankmuenster.mahoe.web.AbstractWebSite
getGenericClassParameter, getMessages, getStartdate, setAccountBasicInfo
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface de.frankmuenster.mahoe.web.WebSite
createSepaTransfer, getAccountInformation, getAccountSheets, getBookedTransactions, getPreBookedTransactions, isStillLoggedIn, login, logoff
-
Constructor Details
-
AbstractSeleniumWebSite
Standardkonstruktor- Parameters:
konto
-- Throws:
WebSiteException
-
-
Method Details
-
getAccountSheetAsByteArray
public static byte[] getAccountSheetAsByteArray(org.apache.commons.lang3.tuple.Pair<Date, ?> document, org.openqa.selenium.WebDriver webClient) throws WebSiteExceptionReturns the account sheet as byte array. The link must be loadable ithout any additional waitings,- Parameters:
document
- the message from the postbox with download link insidewebClient
-- Returns:
- the account sheet as byte array
- Throws:
WebSiteException
- if the download of the account sheet failed
-
getDownloadsDirectory
Returns the temporary folder to use for downloading account sheets. Create a new one per session.- Returns:
- the tmp folder to use during this session
- Throws:
de.willuhn.util.ApplicationException
- if the tmp folder cannot be created
-
shutDown
public static void shutDown()Clean and remove temp-folder and shutdown the driver -
saveCookies
Save the cookies to be used next time -
checkSeleniumDriverSet
Checks if the driver is set and active. if not a status bar message is send that driver is not configured.- Parameters:
driver
- the driver to check- Throws:
WebSiteException
- when the driver is not set
-
elementExits
protected boolean elementExits(org.openqa.selenium.By byId) checks if an element identified byBy
exits- Parameters:
byId
- the element to search for- Returns:
- truer in case the element exists, false else
-
getWebClient
Here we setup the Selenium driver as replacement for the HTMLUnit client.- Specified by:
getWebClient
in classAbstractWebSite<org.openqa.selenium.WebDriver,
I extends WebAccountInformation, M extends AbstractBankMessages<org.openqa.selenium.WebDriver, I>> - Returns:
- den WebClient
- Throws:
WebSiteException
-