public abstract class SmartClientWebDriver
WebDriver
interface providing SmartClient specific enhancements. Additionally several extra methods are provided to correspond one to one with classic Selenium's "Selenese" test language. This, in combination with SeleneseRunner
allows the running of Selenese test files with WebDriver.Modifier and Type | Method and Description |
---|---|
boolean | assertEval(java.lang.String javaScript, java.lang.Boolean expected) Assert condition. |
SmartClientWebDriver | click(org.openqa.selenium.By by) Send a single click to the element specified by the scLocator by |
SmartClientWebDriver | clickAndHold(org.openqa.selenium.By by) Equivalent of our "mouseDown", sent to the element specified by the scLocator by |
SmartClientWebDriver | contextClick(org.openqa.selenium.By by) Send a context (right) click to the element specified by the scLocator by |
SmartClientWebDriver | controlKeyDown() To Support Selenese. |
SmartClientWebDriver | controlKeyUp() To Support Selenese. |
SmartClientWebDriver | doubleClick(org.openqa.selenium.By by) Send a double click to the element specified by the scLocator by |
SmartClientWebDriver | dragAndDrop(org.openqa.selenium.By sourceBy, org.openqa.selenium.By targetBy) Simulate a drag-and-drop from the source scLocator to the target scLocator |
SmartClientWebDriver | dragAndDrop(org.openqa.selenium.By sourceBy, java.lang.String offset) Simulate a drag-and-drop from the source scLocator to the offset coordinates |
SmartClientWebDriver | dragAndDropBy(org.openqa.selenium.By sourceBy, int xOffset, int yOffset) Simulate a drag-and-drop from the source scLocator to the offset coordinates |
void | get(java.lang.String relativeUrl) Fetch a URL relative to the baseURL. |
void | get(java.lang.String relativeUrl, boolean maximize) Fetch a URL relative to the baseURL. |
java.lang.String | getText(org.openqa.selenium.By scLocator) Returns text of element associated with locator. |
java.lang.Object | getValue(org.openqa.selenium.By scLocator) Returns value of element associated with locator. |
SmartClientWebDriver | keyDown(org.openqa.selenium.By by, org.openqa.selenium.Keys theKey) Send a modifer key down event to the element specified by the scLocator by |
SmartClientWebDriver | keyDown(org.openqa.selenium.By by, java.lang.Long charToSend) Send a modifer key down event to the element specified by the scLocator by |
SmartClientWebDriver | keyPress(org.openqa.selenium.By by, java.lang.Long charToSend) Similar to SmartClientWebDriver.sendKeys(org.openqa.selenium.By, java.lang.CharSequence[]) to support selenese conversion |
SmartClientWebDriver | keyPress(org.openqa.selenium.By by, java.lang.String keysToSend) Similar to SmartClientWebDriver.sendKeys(org.openqa.selenium.By, java.lang.CharSequence[]) to support selenese conversion |
SmartClientWebDriver | keyUp(org.openqa.selenium.By by, org.openqa.selenium.Keys theKey) Send a modifer key up event to the element specified by the scLocator by |
SmartClientWebDriver | keyUp(org.openqa.selenium.By by, java.lang.Long charToSend) Send a modifer key up event to the element specified by the scLocator by |
SmartClientWebDriver | mouseMove(org.openqa.selenium.By by) Simulate a mouseOver for the element specified by the scLocator by |
SmartClientWebDriver | release(org.openqa.selenium.By by) Equivalent of our "mouseUp", sent to the element specified by the scLocator by |
SmartClientWebDriver | secondClick(org.openqa.selenium.By by) Send a second click to the element specified by the scLocator by |
SmartClientWebDriver | sendKeys(org.openqa.selenium.By by, java.lang.CharSequence[] keysToSend) Send a sequence of keys to the element specified by the scLocator by |
void | setBaseUrl(java.lang.String baseUrl) Set the Base URL against which tests will run |
void | setUseValueAsTextFallback(boolean useValue) Set whether SmartClientWebDriver.getValue(org.openqa.selenium.By) should be called on locators as a fallback if SmartClientWebDriver.getText(org.openqa.selenium.By) is not able to find anything (other than the empty string). |
SmartClientWebDriver | shiftKeyDown() To Support Selenese. |
SmartClientWebDriver | shiftKeyUp() To Support Selenese. |
void | showConsole() Show the developer console |
SmartClientWebDriver | type(org.openqa.selenium.By by) Similar to SmartClientWebDriver.sendKeys(org.openqa.selenium.By, java.lang.CharSequence[]) to support selenese conversion Clears existing content |
SmartClientWebDriver | type(org.openqa.selenium.By by, java.lang.Long keysToSend) Similar to SmartClientWebDriver.sendKeys(org.openqa.selenium.By, java.lang.CharSequence[]) to support selenese conversion Clears and replaces existing content |
SmartClientWebDriver | type(org.openqa.selenium.By by, java.lang.String keysToSend) Similar to SmartClientWebDriver.sendKeys(org.openqa.selenium.By, java.lang.CharSequence[]) to support selenese conversion Clears and replaces existing content |
boolean | verifyText(org.openqa.selenium.By scLocator, java.lang.String expected) Assert condition. |
boolean | verifyValue(org.openqa.selenium.By scLocator, java.lang.Boolean expected) Assert condition. |
boolean | verifyValue(org.openqa.selenium.By scLocator, java.lang.Integer expected) Assert condition. |
boolean | verifyValue(org.openqa.selenium.By scLocator, java.lang.Long expected) Assert condition. |
boolean | verifyValue(org.openqa.selenium.By scLocator, java.lang.String expected) Assert condition. |
boolean | waitForCondition(java.lang.String javascript, java.lang.Long timeout) Wait for a javascript condition to be true |
boolean | waitForElementClickable(org.openqa.selenium.By by) Wait until a given element responds positively to the isElementClickable() call. |
boolean | waitForElementNotPresent(org.openqa.selenium.By by) Wait until a given element is no longer present. |
boolean | waitForElementPresent(org.openqa.selenium.By by) Wait until a given element is present. |
boolean | waitForFrameToLoad(java.lang.String frameLocator, int secondsMax) Wait until a frame has loaded |
boolean | waitForGridDone(org.openqa.selenium.By by) Wait until a given element responds positively to the isGridDone() call. |
boolean | waitForText(org.openqa.selenium.By by, java.lang.String string) The same as SmartClientWebDriver.waitForText(org.openqa.selenium.By, java.lang.String) below. |
boolean | waitForText(java.lang.String string, org.openqa.selenium.By by) Wait until a given element has a particular text value. |
public boolean waitForElementClickable(org.openqa.selenium.By by)
by
- target elementpublic boolean waitForFrameToLoad(java.lang.String frameLocator, int secondsMax)
public boolean waitForElementPresent(org.openqa.selenium.By by)
public boolean waitForElementNotPresent(org.openqa.selenium.By by)
public boolean waitForText(org.openqa.selenium.By by, java.lang.String string)
SmartClientWebDriver.waitForText(org.openqa.selenium.By, java.lang.String)
below. It would appear selenese does it either way round so we need to implement both!public boolean waitForText(java.lang.String string, org.openqa.selenium.By by)
public boolean waitForGridDone(org.openqa.selenium.By by)
by
- target elementpublic boolean waitForCondition(java.lang.String javascript, java.lang.Long timeout)
timeout
- currently ignoredpublic void setBaseUrl(java.lang.String baseUrl)
public void get(java.lang.String relativeUrl)
relativeUrl
- relative urlpublic void get(java.lang.String relativeUrl, boolean maximize)
relativeUrl
- relative urlmaximize
- whether to maximize windowpublic void showConsole()
public SmartClientWebDriver sendKeys(org.openqa.selenium.By by, java.lang.CharSequence[] keysToSend)
by
- Indicates the element concerned. If null then the previous elementpublic SmartClientWebDriver type(org.openqa.selenium.By by)
SmartClientWebDriver.sendKeys(org.openqa.selenium.By, java.lang.CharSequence[])
to support selenese conversion Clears existing contentby
- Indicates the element concerned. If null then the previous elementpublic SmartClientWebDriver type(org.openqa.selenium.By by, java.lang.String keysToSend)
SmartClientWebDriver.sendKeys(org.openqa.selenium.By, java.lang.CharSequence[])
to support selenese conversion Clears and replaces existing contentby
- Indicates the element concerned. If null then the previous elementpublic SmartClientWebDriver type(org.openqa.selenium.By by, java.lang.Long keysToSend)
SmartClientWebDriver.sendKeys(org.openqa.selenium.By, java.lang.CharSequence[])
to support selenese conversion Clears and replaces existing contentby
- Indicates the element concerned. If null then the previous elementpublic SmartClientWebDriver keyPress(org.openqa.selenium.By by, java.lang.Long charToSend)
SmartClientWebDriver.sendKeys(org.openqa.selenium.By, java.lang.CharSequence[])
to support selenese conversionby
- Indicates the element concerned. If null then the previous elementpublic SmartClientWebDriver keyPress(org.openqa.selenium.By by, java.lang.String keysToSend)
SmartClientWebDriver.sendKeys(org.openqa.selenium.By, java.lang.CharSequence[])
to support selenese conversionby
- Indicates the element concerned. If null then the previous elementpublic SmartClientWebDriver keyDown(org.openqa.selenium.By by, java.lang.Long charToSend)
by
- Indicates the element concerned. If null then the previous elementcharToSend
- Javascript key code for a modifier keypublic SmartClientWebDriver keyUp(org.openqa.selenium.By by, java.lang.Long charToSend)
by
- Indicates the element concerned. If null then the previous elementcharToSend
- Javascript key code for a modifier keypublic SmartClientWebDriver keyDown(org.openqa.selenium.By by, org.openqa.selenium.Keys theKey)
by
- Indicates the element concerned. If null then the previous elementpublic SmartClientWebDriver keyUp(org.openqa.selenium.By by, org.openqa.selenium.Keys theKey)
by
- Indicates the element concerned. If null then the previous elementpublic SmartClientWebDriver shiftKeyDown()
public SmartClientWebDriver shiftKeyUp()
public SmartClientWebDriver controlKeyDown()
public SmartClientWebDriver controlKeyUp()
public SmartClientWebDriver click(org.openqa.selenium.By by)
by
- Indicates the element concerned. If null then the previous elementpublic SmartClientWebDriver secondClick(org.openqa.selenium.By by)
by
- Indicates the element concerned. If null then the previous elementpublic SmartClientWebDriver doubleClick(org.openqa.selenium.By by)
by
- Indicates the element concerned. If null then the previous elementpublic SmartClientWebDriver clickAndHold(org.openqa.selenium.By by)
by
- Indicates the element concerned. If null then the previous elementpublic SmartClientWebDriver release(org.openqa.selenium.By by)
by
- Indicates the element concerned. If null then the previous elementpublic SmartClientWebDriver contextClick(org.openqa.selenium.By by)
by
- Indicates the element concerned. If null then the previous element.public SmartClientWebDriver mouseMove(org.openqa.selenium.By by)
by
- Indicates the element to move topublic SmartClientWebDriver dragAndDrop(org.openqa.selenium.By sourceBy, org.openqa.selenium.By targetBy)
sourceBy
- Indicates the element to drag. If null then the previous elementtargetBy
- The destinationpublic SmartClientWebDriver dragAndDrop(org.openqa.selenium.By sourceBy, java.lang.String offset)
sourceBy
- Indicates the element to drag. If null then the previous elementoffset
- Selenese compatible string arg. Eg: "-70/+0"public SmartClientWebDriver dragAndDropBy(org.openqa.selenium.By sourceBy, int xOffset, int yOffset)
sourceBy
- Indicates the element to drag. If null then the previous elementpublic java.lang.Object getValue(org.openqa.selenium.By scLocator)
In Junit, for example: verifyEquals(driver.getValue(locator), 1234L)
public boolean verifyValue(org.openqa.selenium.By scLocator, java.lang.Boolean expected)
public boolean verifyValue(org.openqa.selenium.By scLocator, java.lang.Long expected)
public boolean verifyValue(org.openqa.selenium.By scLocator, java.lang.Integer expected)
public boolean verifyValue(org.openqa.selenium.By scLocator, java.lang.String expected)
public boolean assertEval(java.lang.String javaScript, java.lang.Boolean expected)
public java.lang.String getText(org.openqa.selenium.By scLocator)
public boolean verifyText(org.openqa.selenium.By scLocator, java.lang.String expected)
public void setUseValueAsTextFallback(boolean useValue)
SmartClientWebDriver.getValue(org.openqa.selenium.By)
should be called on locators as a fallback if SmartClientWebDriver.getText(org.openqa.selenium.By)
is not able to find anything (other than the empty string). We do this by default, so this method must be called to avoid the fallback check.useValue
- whether to do fallback check