Package de.frankmuenster.mahoe.utils
Class WebUtilsSelenium
- java.lang.Object
-
- de.frankmuenster.mahoe.utils.WebUtilsSelenium
-
public final class WebUtilsSelenium extends java.lang.Object
Utility class for web methods- Author:
- Frank Münster
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static byte[]
getSeleniumPdfAsByteArray(org.openqa.selenium.WebDriver driver, org.openqa.selenium.WebElement linkElement)
Read the account statement PDF into a byte array.static byte[]
getSeleniumPdfAsByteArray(org.openqa.selenium.WebDriver driver, org.openqa.selenium.WebElement linkElement, java.lang.String expectedFileName)
Read the account statement PDF into a byte array.static void
scrollTo(org.openqa.selenium.WebDriver driver, org.openqa.selenium.WebElement element)
Scroll to an element so it is visible at the top on topstatic void
scrollTo(org.openqa.selenium.WebDriver driver, org.openqa.selenium.WebElement element, boolean scrollTo)
Scroll to an element so it is visible at scrollTo position
-
-
-
Method Detail
-
getSeleniumPdfAsByteArray
public static byte[] getSeleniumPdfAsByteArray(org.openqa.selenium.WebDriver driver, org.openqa.selenium.WebElement linkElement) throws WebSiteException
Read the account statement PDF into a byte array.- Parameters:
driver
- theWebDriver
to uselinkElement
- the link on the page to the PDFexpectedFileName
-- Returns:
- the PDF as byte array
- Throws:
WebSiteException
-
getSeleniumPdfAsByteArray
public static byte[] getSeleniumPdfAsByteArray(org.openqa.selenium.WebDriver driver, org.openqa.selenium.WebElement linkElement, java.lang.String expectedFileName)
Read the account statement PDF into a byte array.- Parameters:
driver
- theWebDriver
to uselinkElement
- the link on the page to the PDFexpectedFileName
-- Returns:
- the PDF as byte array
-
scrollTo
public static void scrollTo(org.openqa.selenium.WebDriver driver, org.openqa.selenium.WebElement element)
Scroll to an element so it is visible at the top on top
-
scrollTo
public static void scrollTo(org.openqa.selenium.WebDriver driver, org.openqa.selenium.WebElement element, boolean scrollTo)
Scroll to an element so it is visible at scrollTo position- Parameters:
scrollTo
- true top of element on top of view area, false bottom of element on bottom of view area
-
-