public final class SeleniumWComponentsUtil extends Object
Utility class containing convenience methods for testing WComponents with Selenium.
Logic has been extracted into this utility class for any consumers who cannot extend WComponentSeleniumTestCase due to a different test class hierarchy.
| Modifier and Type | Method and Description |
|---|---|
static void |
configureDriver(org.openqa.selenium.WebDriver driver)
Configure the WebDriver with the standard WComponents configuration.
|
static void |
configureImmediateImplicitWait(org.openqa.selenium.WebDriver driver)
Configure the WebDriver implicit wait for immediate find.
|
static void |
configureImplicitWait(org.openqa.selenium.WebDriver driver)
Configure the WebDriver implicit wait.
|
static void |
configureImplicitWait(org.openqa.selenium.WebDriver driver,
long time,
TimeUnit unit)
Configure the WebDriver implicit wait.
|
static org.openqa.selenium.WebElement |
findElementImmediateForDriver(org.openqa.selenium.WebDriver driver,
org.openqa.selenium.By by)
Find immediately the first element via the driver using the given method.
|
static org.openqa.selenium.WebElement |
findElementImmediateForElement(org.openqa.selenium.WebElement element,
org.openqa.selenium.By by)
Find immediately the first element via the passed in element and given method.
|
static List<org.openqa.selenium.WebElement> |
findElementsImmediateForDriver(org.openqa.selenium.WebDriver driver,
org.openqa.selenium.By by)
Find immediately the elements via the driver using the given method.
|
static List<org.openqa.selenium.WebElement> |
findElementsImmediateForElement(org.openqa.selenium.WebElement element,
org.openqa.selenium.By by)
Find immediately the elements via the passed in element and given method.
|
static SeleniumWDialogWebElement |
getDialog(org.openqa.selenium.WebDriver driver)
Get the screen's dialog, whether it is open or not.
|
static org.openqa.selenium.support.ui.ExpectedCondition<Boolean> |
getPageReadyCondition()
Get the ExpectedCondition for waiting for the WComponents page to be ready.
|
static boolean |
isOpenDialog(org.openqa.selenium.WebDriver driver)
Is there an open dialog on the screen?
|
static void |
waitForPageReady(org.openqa.selenium.WebDriver driver)
Wait for the page to have loaded, including all AJAX and JavaScript.
|
static void |
waitForPageReady(org.openqa.selenium.WebDriver driver,
int timeoutSeconds,
long pollingMilliseconds)
Wait for the page to have loaded, including all AJAX and JavaScript.
|
static SeleniumWComponentInputWebElement |
wrapInputElementWithTypedWebElement(org.openqa.selenium.WebDriver driver,
org.openqa.selenium.WebElement element)
Analyze the input element and attempt to wrap it in the appropriate component-specific subclass.
|
public static void configureDriver(org.openqa.selenium.WebDriver driver)
driver - the WebDriver to configure.public static void configureImplicitWait(org.openqa.selenium.WebDriver driver)
driver - the WebDriver to configure.public static void configureImmediateImplicitWait(org.openqa.selenium.WebDriver driver)
driver - the WebDriver to configure.public static void configureImplicitWait(org.openqa.selenium.WebDriver driver,
long time,
TimeUnit unit)
driver - the WebDriver to configure.time - the amount of time to wait.unit - the unit of measure for time.public static void waitForPageReady(org.openqa.selenium.WebDriver driver)
driver - the WebDriver.public static void waitForPageReady(org.openqa.selenium.WebDriver driver,
int timeoutSeconds,
long pollingMilliseconds)
driver - the WebDriver.timeoutSeconds - - the number of seconds after which the 'wait' will time out.pollingMilliseconds - - the number of milliseconds to wait between each poll attempt.public static boolean isOpenDialog(org.openqa.selenium.WebDriver driver)
driver - the WebDriver.public static SeleniumWDialogWebElement getDialog(org.openqa.selenium.WebDriver driver)
driver - the WebDriver.public static org.openqa.selenium.support.ui.ExpectedCondition<Boolean> getPageReadyCondition()
public static SeleniumWComponentInputWebElement wrapInputElementWithTypedWebElement(org.openqa.selenium.WebDriver driver, org.openqa.selenium.WebElement element)
driver - the WebDriver.element - the default Selenium WebElement.public static org.openqa.selenium.WebElement findElementImmediateForDriver(org.openqa.selenium.WebDriver driver,
org.openqa.selenium.By by)
driver - the web driverby - the by conditionpublic static List<org.openqa.selenium.WebElement> findElementsImmediateForDriver(org.openqa.selenium.WebDriver driver, org.openqa.selenium.By by)
driver - the web driverby - the by conditionpublic static org.openqa.selenium.WebElement findElementImmediateForElement(org.openqa.selenium.WebElement element,
org.openqa.selenium.By by)
element - the web driverby - the by conditionpublic static List<org.openqa.selenium.WebElement> findElementsImmediateForElement(org.openqa.selenium.WebElement element, org.openqa.selenium.By by)
element - the web driverby - the by conditionCopyright © 2024. All rights reserved.