Class AbstractSeleniumWebSite<I extends WebAccountInformation,​M extends AbstractBankMessages<org.openqa.selenium.WebDriver>>

  • Type Parameters:
    I - the concrete WebAccountInformation
    M - 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>>
    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
    • Constructor Detail

      • AbstractSeleniumWebSite

        protected AbstractSeleniumWebSite​(de.willuhn.jameica.hbci.rmi.Konto konto)
                                   throws WebSiteException
        Standardkonstruktor
        Parameters:
        konto -
        Throws:
        WebSiteException
    • Method Detail

      • getAccountSheetAsByteArray

        public static byte[] getAccountSheetAsByteArray​(org.apache.commons.lang3.tuple.Pair<java.util.Date,​org.openqa.selenium.WebElement> document,
                                                        org.openqa.selenium.WebDriver webClient)
                                                 throws WebSiteException
        Returns 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 inside
        webClient -
        Returns:
        the account sheet as byte array
        Throws:
        WebSiteException - if the download of the account sheet failed
      • getDownloadsDirectory

        public static java.nio.file.Path getDownloadsDirectory()
                                                        throws de.willuhn.util.ApplicationException
        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

        public void saveCookies​(java.lang.String backupFileName)
        Save the cookies to be used next time
      • checkSeleniumDriverSet

        protected void checkSeleniumDriverSet​(org.openqa.selenium.WebDriver driver)
                                       throws WebSiteException
        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 by By exits
        Parameters:
        byId - the element to search for
        Returns:
        truer in case the element exists, false else
      • getWebClient

        protected org.openqa.selenium.WebDriver getWebClient()
        Here we setup the Selenium driver as replacement for the HTMLUnit client.
        Specified by:
        getWebClient in class AbstractWebSite<org.openqa.selenium.WebDriver,​I extends WebAccountInformation,​M extends AbstractBankMessages<org.openqa.selenium.WebDriver>>
        Returns:
        den WebClient