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 |
close()
.
|
SeleniumWComponentWebElement |
findElement(org.openqa.selenium.By by)
.
|
SeleniumWComponentWebElement |
findElement(ByWComponent by)
Find a WComponent that was created in the same JVM as the servlet.
|
List<org.openqa.selenium.WebElement> |
findElements(org.openqa.selenium.By by)
.
|
List<org.openqa.selenium.WebElement> |
findElements(ByWComponent by)
Find WComponents that were created in the same JVM as the servlet.
|
SeleniumWEmailFieldWebElement |
findWEmailField(org.openqa.selenium.By by)
Find a WEmailField by the given criteria.
|
SeleniumWPhoneNumberFieldWebElement |
findWPhoneNumberField(org.openqa.selenium.By by)
Find a WEmailField 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()
.
|
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()
.
|
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()
.
|
void |
waitForPageReady()
Wait until the page is fully loaded (including AJAX and timers).
|
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 List<org.openqa.selenium.WebElement> findElements(org.openqa.selenium.By by)
findElements in interface org.openqa.selenium.SearchContextfindElements in interface org.openqa.selenium.WebDriverpublic SeleniumWComponentWebElement findElement(org.openqa.selenium.By by)
findElement in interface org.openqa.selenium.SearchContextfindElement in interface org.openqa.selenium.WebDriverpublic 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 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 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()
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 typeCopyright © 2016. All rights reserved.