public abstract class SmartClientWebDriver
extends java.lang.Object
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 | getTable(org.openqa.selenium.By scLocator, long row, long col) Returns the specified table cell display value. |
java.lang.String | getText(org.openqa.selenium.By scLocator) Returns text of element associated with locator, or the value if there's no associated text. |
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 |
void | pause(long waitInMillis) Wait for the specified amount of time. |
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 | setDefaultWaitTimeout(int timeoutInSeconds) Change the default timeout for the methods that wait to the supplied number of seconds. |
void | setUseFrameworkValueAsFallback(boolean useFrameworkValue) Sets 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 | verifyTable(org.openqa.selenium.By scLocator, long row, long col, java.lang.String expected) Verify that specified table cell display value matches the pattern. |
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) Wait for a javascript condition to be true. |
boolean | waitForCondition(java.lang.String javascript, int timeoutInSeconds) 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 | waitForElementClickable(org.openqa.selenium.By by, int timeoutInSeconds) 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 | waitForElementNotPresent(org.openqa.selenium.By by, int timeoutInSeconds) Wait until a given element is no longer present. |
boolean | waitForElementPresent(org.openqa.selenium.By by) Wait until a given element is present. |
boolean | waitForElementPresent(org.openqa.selenium.By by, int timeoutInSeconds) Wait until a given element is present. |
boolean | waitForElementReadyForKeyPresses(org.openqa.selenium.By by) Wait until a given element responds positively to the isElementReadyForKeyPresses() call. |
boolean | waitForElementReadyForKeyPresses(org.openqa.selenium.By by, int timeoutInSeconds) Wait until a given element responds positively to the isElementReadyForKeyPresses() call. |
boolean | waitForFrameToLoad(java.lang.String frameLocator, int timeoutInSeconds) 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 | waitForGridDone(org.openqa.selenium.By by, int timeoutInSeconds) Wait until a given element responds positively to the isGridDone() call. |
boolean | waitForSystemDone() Wait until a given element responds positively to the isSystemDone() call. |
boolean | waitForSystemDone(int timeoutInSeconds) Wait until a given element responds positively to the isSystemDone() call. |
boolean | waitForText(org.openqa.selenium.By by, java.lang.String string) Wait until a given element has a particular text value. |
boolean | waitForText(org.openqa.selenium.By by, java.lang.String string, int timeoutInSeconds) Wait until a given element has a particular text value. |
boolean | waitForText(java.lang.String string, org.openqa.selenium.By by) Deprecated. Use SmartClientWebDriver.waitForText(org.openqa.selenium.By, java.lang.String) instead, which has a more standard parameter order. |
public void setDefaultWaitTimeout(int timeoutInSeconds)
timeoutInSeconds
- new default timeout, in seconds (must be positive)public boolean waitForElementClickable(org.openqa.selenium.By by)
by
- target elementpublic boolean waitForElementClickable(org.openqa.selenium.By by, int timeoutInSeconds)
by
- target elementtimeoutInSeconds
- seconds to wait (ignored if non-positive - default used)public boolean waitForElementReadyForKeyPresses(org.openqa.selenium.By by)
by
- target elementpublic boolean waitForElementReadyForKeyPresses(org.openqa.selenium.By by, int timeoutInSeconds)
by
- target elementtimeoutInSeconds
- seconds to wait (ignored if non-positive - default used)public boolean waitForGridDone(org.openqa.selenium.By by)
by
- target elementpublic boolean waitForGridDone(org.openqa.selenium.By by, int timeoutInSeconds)
by
- target elementtimeoutInSeconds
- seconds to wait (ignored if non-positive - default used)public boolean waitForSystemDone()
public boolean waitForSystemDone(int timeoutInSeconds)
timeoutInSeconds
- seconds to wait (ignored if non-positive - default used)public boolean waitForElementPresent(org.openqa.selenium.By by)
by
- target elementpublic boolean waitForElementPresent(org.openqa.selenium.By by, int timeoutInSeconds)
by
- target elementtimeoutInSeconds
- seconds to wait (ignored if non-positive - default used)public boolean waitForElementNotPresent(org.openqa.selenium.By by)
by
- target elementpublic boolean waitForElementNotPresent(org.openqa.selenium.By by, int timeoutInSeconds)
by
- target elementtimeoutInSeconds
- seconds to wait (ignored if non-positive - default used)public boolean waitForText(org.openqa.selenium.By by, java.lang.String string)
by
- target elementstring
- desired textpublic boolean waitForText(org.openqa.selenium.By by, java.lang.String string, int timeoutInSeconds)
by
- target elementstring
- desired texttimeoutInSeconds
- seconds to wait (ignored if non-positive - default used)@Deprecated public boolean waitForText(java.lang.String string, org.openqa.selenium.By by)
SmartClientWebDriver.waitForText(org.openqa.selenium.By, java.lang.String)
instead, which has a more standard parameter order.public boolean waitForCondition(java.lang.String javascript)
javascript
- script to runpublic boolean waitForCondition(java.lang.String javascript, int timeoutInSeconds)
javascript
- script to runtimeoutInSeconds
- seconds to wait (ignored if non-positive - default used)public boolean waitForFrameToLoad(java.lang.String frameLocator, int timeoutInSeconds)
frameLocator
- locatortimeoutInSeconds
- seconds to waitpublic void pause(long waitInMillis)
waitInMillis
- amount of time, in milliseconds, to waitpublic 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 element.keysToSend
- the sequence(s) of keys to sendpublic 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 element.public 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 element.keysToSend
- keys to sendpublic 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 element.keysToSend
- Long to send as textpublic 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 element.charToSend
- Javascript key code for a modifier keypublic 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 element.keysToSend
- keys to sendpublic SmartClientWebDriver keyDown(org.openqa.selenium.By by, java.lang.Long charToSend)
by
- Indicates the element concerned. If null then the previous element.charToSend
- 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 element.charToSend
- 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 element.theKey
- modifier keypublic SmartClientWebDriver keyUp(org.openqa.selenium.By by, org.openqa.selenium.Keys theKey)
by
- Indicates the element concerned. If null then the previous element.theKey
- modifier keypublic 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 element.public SmartClientWebDriver secondClick(org.openqa.selenium.By by)
by
- Indicates the element concerned. If null then the previous element.public SmartClientWebDriver doubleClick(org.openqa.selenium.By by)
by
- Indicates the element concerned. If null then the previous element.public SmartClientWebDriver clickAndHold(org.openqa.selenium.By by)
by
- Indicates the element concerned. If null then the previous element.public SmartClientWebDriver release(org.openqa.selenium.By by)
by
- Indicates the element concerned. If null then the previous element.public 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 element.targetBy
- The destinationpublic SmartClientWebDriver dragAndDrop(org.openqa.selenium.By sourceBy, java.lang.String offset)
sourceBy
- Indicates the element to drag. If null then the previous element.offset
- 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 element.public 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)
SmartClientWebDriver.setUseFrameworkValueAsFallback(boolean)
for details on what value is used.)public boolean verifyText(org.openqa.selenium.By scLocator, java.lang.String expected)
public java.lang.String getTable(org.openqa.selenium.By scLocator, long row, long col)
SmartClientWebDriver.setUseFrameworkValueAsFallback(boolean)
for details on what value is used.)public boolean verifyTable(org.openqa.selenium.By scLocator, long row, long col, java.lang.String expected)
public void setUseFrameworkValueAsFallback(boolean useFrameworkValue)
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). If not set, the "value" attribute of the WebElement will be used as the fallback instead. This will typically be the "display value" of the element, rather than its "Framework value" (as returned by SmartClientWebDriver.getValue(org.openqa.selenium.By)
). Default is true.useFrameworkValue
- whether to use the Framework value as the fallback