T - - the type of backing WebDriver class.public class SeleniumWComponentsWebDriver<T extends org.openqa.selenium.WebDriver> extends Object implements org.openqa.selenium.WebDriver, org.openqa.selenium.TakesScreenshot
WComponent utility class to wrap a Selenium WebDriver.
This class will automatically wait for the WComponents UI to finish loading (including JavaScript and AJAX) where appropriate.
org.openqa.selenium.WebDriver.ImeHandler, org.openqa.selenium.WebDriver.Navigation, org.openqa.selenium.WebDriver.Options, org.openqa.selenium.WebDriver.TargetLocator, org.openqa.selenium.WebDriver.Timeouts, org.openqa.selenium.WebDriver.Window| Constructor and Description |
|---|
SeleniumWComponentsWebDriver()
No-arg constructor to support creation via other frameworks.
|
SeleniumWComponentsWebDriver(T driver)
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clearUserContext()
Clear the user context on the session.
|
void |
close()
.
|
SeleniumWComponentWebElement |
findElement(org.openqa.selenium.By by)
.
|
SeleniumWComponentWebElement |
findElement(org.openqa.selenium.By by,
boolean pageWait) |
SeleniumWComponentWebElement |
findElement(ByWComponent by)
Find a WComponent that was created in the same JVM as the servlet.
|
SeleniumWComponentWebElement |
findElement(ByWComponent by,
boolean pageWait)
Find a WComponent that was created in the same JVM as the servlet.
|
SeleniumWComponentWebElement |
findElementImmediate(org.openqa.selenium.By by)
Find immediate with no polling.
|
List<org.openqa.selenium.WebElement> |
findElements(org.openqa.selenium.By by)
.
|
List<org.openqa.selenium.WebElement> |
findElements(org.openqa.selenium.By by,
boolean pageWait) |
List<org.openqa.selenium.WebElement> |
findElements(ByWComponent by)
Find WComponents that were created in the same JVM as the servlet.
|
List<org.openqa.selenium.WebElement> |
findElements(ByWComponent by,
boolean pageWait)
Find WComponents that were created in the same JVM as the servlet.
|
List<org.openqa.selenium.WebElement> |
findElementsImmediate(org.openqa.selenium.By by)
Find immediate with no polling.
|
SeleniumWCheckBoxWebElement |
findWCheckBox(org.openqa.selenium.By by)
Find a WCheckBox by the given criteria.
|
SeleniumWCheckBoxSelectWebElement |
findWCheckBoxSelect(org.openqa.selenium.By by)
Find a WCheckBoxSelect by the given criteria.
|
SeleniumWSelectWebElement |
findWDropdown(org.openqa.selenium.By by)
Find a WDropdown by the given criteria.
|
SeleniumWEmailFieldWebElement |
findWEmailField(org.openqa.selenium.By by)
Find a WEmailField by the given criteria.
|
SeleniumWLabelWebElement |
findWLabel(org.openqa.selenium.By by)
Find a WLabel by the given criteria.
|
SeleniumWLabelWebElement |
findWLabelWithPartialText(String text)
Find a WLabel containing given text.
|
SeleniumWLabelWebElement |
findWLabelWithPartialText(String text,
int idx)
Find a WLabel containing given text.
|
SeleniumWMessageBoxWebElement |
findWMessageBox(org.openqa.selenium.By by)
Find a WMessageBox by the given criteria.
|
SeleniumWMessagesWebElement |
findWMessages(org.openqa.selenium.By by)
Find a WMessages by the given criteria.
|
SeleniumWMultiDropdownWebElement |
findWMultiDropdown(org.openqa.selenium.By by)
Fins a WMultiDropdown by the given criteria.
|
SeleniumWSelectWebElement |
findWMultiSelect(org.openqa.selenium.By by)
Find a WMultiSelect by the given criteria.
|
SeleniumWMultiSelectPairWebElement |
findWMultiSelectPair(org.openqa.selenium.By by)
Find a WMultiSelectPair by the given criteria.
|
SeleniumWPhoneNumberFieldWebElement |
findWPhoneNumberField(org.openqa.selenium.By by)
Find a WEmailField by the given criteria.
|
SeleniumWRadioButtonWebElement |
findWRadioButton(org.openqa.selenium.By by)
Find a WRadioButton by the given criteria.
|
SeleniumWRadioButtonSelectWebElement |
findWRadioButtonSelect(org.openqa.selenium.By by)
Find a WRadioButtonSelect by the given criteria.
|
SeleniumWSelectWebElement |
findWSingleSelect(org.openqa.selenium.By by)
Find a WSingleSelect by the given criteria.
|
SeleniumWTableWebElement |
findWTable(org.openqa.selenium.By by)
Find a WTable by the given criteria.
|
SeleniumWTextAreaWebElement |
findWTextArea(org.openqa.selenium.By by)
Find a WTextArea by the given criteria.
|
SeleniumWTextFieldWebElement |
findWTextField(org.openqa.selenium.By by)
Find a WTextField by the given criteria.
|
void |
get(String url)
.
|
String |
getCurrentUrl()
.
|
SeleniumWDialogWebElement |
getDialog()
Get the dialog.
|
T |
getDriver()
Directly expose the driver for any special APIs.
|
String |
getPageSource()
.
|
<X> X |
getScreenshotAs(org.openqa.selenium.OutputType<X> target)
Capture a screenshot if the backing driver supports it.
|
String |
getSessionId() |
String |
getTitle()
.
|
UIContext |
getUserContextForSession() |
String |
getWindowHandle()
.
|
Set<String> |
getWindowHandles()
.
|
boolean |
hasSession() |
boolean |
isOpenDialog()
Is there an open dialog on the screen?
|
org.openqa.selenium.WebDriver.Options |
manage()
.
|
org.openqa.selenium.WebDriver.Navigation |
navigate()
.
|
org.openqa.selenium.WebDriver.Navigation |
navigate(boolean wait)
Navigate with an option to wait for the current page to be ready first.
|
void |
newSession()
Start a new session, using the current URL.
|
void |
newSession(String url)
Start a new session with the given URL.
|
void |
quit()
.
|
org.openqa.selenium.WebDriver.TargetLocator |
switchTo()
.
|
org.openqa.selenium.WebDriver.TargetLocator |
switchTo(boolean wait)
Call switchTo after an optional check of pageReady.
|
void |
waitForPageReady()
Wait until the page is fully loaded (including AJAX and timers).
|
protected SeleniumWComponentWebElement |
wrapElement(org.openqa.selenium.WebElement element) |
public SeleniumWComponentsWebDriver()
No-arg constructor to support creation via other frameworks.
This implementation will be backed by the driver implementation configured in
ParameterizedWebDriverType
public SeleniumWComponentsWebDriver(T driver)
driver - the backing web driver.public void newSession()
public boolean hasSession()
public void newSession(String url)
url - the URL of the page to load.public String getSessionId()
public T getDriver()
public void waitForPageReady()
public boolean isOpenDialog()
public SeleniumWDialogWebElement getDialog()
public void get(String url)
get in interface org.openqa.selenium.WebDriverpublic String getCurrentUrl()
getCurrentUrl in interface org.openqa.selenium.WebDriverpublic String getTitle()
getTitle in interface org.openqa.selenium.WebDriverpublic SeleniumWTextAreaWebElement findWTextArea(org.openqa.selenium.By by)
by - the By selector.public SeleniumWTextFieldWebElement findWTextField(org.openqa.selenium.By by)
by - the By selector.public SeleniumWEmailFieldWebElement findWEmailField(org.openqa.selenium.By by)
by - the By selector.public SeleniumWPhoneNumberFieldWebElement findWPhoneNumberField(org.openqa.selenium.By by)
by - the By selector.public SeleniumWTableWebElement findWTable(org.openqa.selenium.By by)
by - the By selector.public SeleniumWCheckBoxWebElement findWCheckBox(org.openqa.selenium.By by)
by - the By selectorpublic SeleniumWRadioButtonWebElement findWRadioButton(org.openqa.selenium.By by)
by - the By selectorpublic SeleniumWRadioButtonSelectWebElement findWRadioButtonSelect(org.openqa.selenium.By by)
by - the By selectorpublic SeleniumWSelectWebElement findWDropdown(org.openqa.selenium.By by)
by - the By selectorpublic SeleniumWSelectWebElement findWSingleSelect(org.openqa.selenium.By by)
by - the By selectorpublic SeleniumWMessagesWebElement findWMessages(org.openqa.selenium.By by)
by - the By selectorpublic SeleniumWMessageBoxWebElement findWMessageBox(org.openqa.selenium.By by)
by - the By selectorpublic SeleniumWMultiDropdownWebElement findWMultiDropdown(org.openqa.selenium.By by)
by - the By selectorpublic SeleniumWSelectWebElement findWMultiSelect(org.openqa.selenium.By by)
by - the By selectorpublic SeleniumWMultiSelectPairWebElement findWMultiSelectPair(org.openqa.selenium.By by)
by - the By selectorpublic SeleniumWLabelWebElement findWLabel(org.openqa.selenium.By by)
by - the By selectorpublic SeleniumWCheckBoxSelectWebElement findWCheckBoxSelect(org.openqa.selenium.By by)
by - the By selectorpublic SeleniumWLabelWebElement findWLabelWithPartialText(String text, int idx)
text - the text in the labelidx - the index to apply the selector to get the nth label when there are multiple on a pagepublic SeleniumWLabelWebElement findWLabelWithPartialText(String text)
text - the text in the labelpublic SeleniumWComponentWebElement findElementImmediate(org.openqa.selenium.By by)
by - the by conditionpublic List<org.openqa.selenium.WebElement> findElementsImmediate(org.openqa.selenium.By by)
by - the by conditionpublic List<org.openqa.selenium.WebElement> findElements(org.openqa.selenium.By by)
findElements in interface org.openqa.selenium.SearchContextfindElements in interface org.openqa.selenium.WebDriverpublic List<org.openqa.selenium.WebElement> findElements(org.openqa.selenium.By by, boolean pageWait)
by - the by conditionpageWait - true if do wait for page ready before doing findpublic SeleniumWComponentWebElement findElement(org.openqa.selenium.By by)
findElement in interface org.openqa.selenium.SearchContextfindElement in interface org.openqa.selenium.WebDriverpublic SeleniumWComponentWebElement findElement(org.openqa.selenium.By by, boolean pageWait)
by - the matchpageWait - true if wait for page ready before do findpublic List<org.openqa.selenium.WebElement> findElements(ByWComponent by)
Find WComponents that were created in the same JVM as the servlet.
This method requires that SeleniumLauncher (or subclass) was used to launch the server.
by - the ByWcomponent to find.public List<org.openqa.selenium.WebElement> findElements(ByWComponent by, boolean pageWait)
Find WComponents that were created in the same JVM as the servlet.
This method requires that SeleniumLauncher (or subclass) was used to launch the server.
by - the ByWcomponent to find.pageWait - true if wait for page ready before do findpublic SeleniumWComponentWebElement findElement(ByWComponent by)
Find a WComponent that was created in the same JVM as the servlet.
This method requires that SeleniumLauncher (or subclass) was used to launch the server.
by - the ByWcomponent to find.public SeleniumWComponentWebElement findElement(ByWComponent by, boolean pageWait)
Find a WComponent that was created in the same JVM as the servlet.
This method requires that SeleniumLauncher (or subclass) was used to launch the server.
by - the ByWcomponent to find.pageWait - true if wait for page ready before do findpublic String getPageSource()
getPageSource in interface org.openqa.selenium.WebDriverpublic void close()
close in interface org.openqa.selenium.WebDriverpublic void quit()
quit in interface org.openqa.selenium.WebDriverpublic Set<String> getWindowHandles()
getWindowHandles in interface org.openqa.selenium.WebDriverpublic String getWindowHandle()
getWindowHandle in interface org.openqa.selenium.WebDriverpublic org.openqa.selenium.WebDriver.TargetLocator switchTo(boolean wait)
wait - if true wait for pageReady before switchingpublic org.openqa.selenium.WebDriver.Navigation navigate(boolean wait)
wait - if true wait for pageReady before navigatingpublic org.openqa.selenium.WebDriver.TargetLocator switchTo()
switchTo in interface org.openqa.selenium.WebDriverpublic org.openqa.selenium.WebDriver.Navigation navigate()
navigate in interface org.openqa.selenium.WebDriverpublic org.openqa.selenium.WebDriver.Options manage()
manage in interface org.openqa.selenium.WebDriverpublic <X> X getScreenshotAs(org.openqa.selenium.OutputType<X> target)
Capture a screenshot if the backing driver supports it.
IMPORTANT: This function will log warnings and return null if a screenshot cannot be captured.
getScreenshotAs in interface org.openqa.selenium.TakesScreenshotX - - the output type.target - - the target output typepublic UIContext getUserContextForSession()
public void clearUserContext()
protected SeleniumWComponentWebElement wrapElement(org.openqa.selenium.WebElement element)
element - the element to wrapSeleniumWComponentWebElementCopyright © 2018. All rights reserved.