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) Assert that the specified JavaScript script evaluates to empty String or null. |
boolean | assertEval(java.lang.String javaScript, java.lang.Object expected) Assert that the specified JavaScript script evaluates equal to the expected value. |
boolean | assertEval(java.lang.String javaScript, java.lang.Object expected, boolean asJavaScriptString) Assert that the specified JavaScript script evaluates equal to the expected value. |
boolean | assertEval(java.lang.String javaScript, java.lang.String expected) Assert that the specified JavaScript script evaluates equal to the expected value. |
boolean | assertEval(java.lang.String javaScript, java.lang.String expected, boolean asJavaScriptString) Assert that the specified JavaScript script evaluates equal to the expected value. |
SmartClientWebDriver | blur(By by) Blurs the target element or canvas. |
java.lang.Boolean | clearCanvasProperty(By scLocator, java.lang.String propertyName) Clears the specified canvas property by setting it null . |
void | clearTolerances() Resets all tolerances to their default values. |
SmartClientWebDriver | click(By by) Send a single click to the locator target. |
SmartClientWebDriver | clickAndHold(By by) Equivalent of our "mouseDown", sent to locator target. |
SmartClientWebDriver | clickAndHoldAt(By by, int xOffset, int yOffset) Equivalent of our "mouseDown", sent to an offset from locator target's left, top corner. |
SmartClientWebDriver | contextClick(By by) Send a context (right) click to the locator target. |
SmartClientWebDriver | controlKeyDown() To Support Selenese. |
SmartClientWebDriver | controlKeyUp() To Support Selenese. |
SmartClientWebDriver | doubleClick(By by) Send a double click to the locator target. |
SmartClientWebDriver | dragAndDrop(By sourceBy, By targetBy) Simulate a drag-and-drop from the source locator to the target locator. |
SmartClientWebDriver | dragAndDrop(By sourceBy, java.lang.String offset) Deprecated. use the variant that takes separate coordinate offsets |
SmartClientWebDriver | dragAndDropBy(By sourceBy, int xOffset, int yOffset) Simulate a drag-and-drop from the source locator by the horizontal and vertical offsets. |
SmartClientWebDriver | focus(By by) Set focus into the target element or canvas. |
SmartClientWebDriver | focus(By by, boolean clearModifiers) Set focus into the target element or canvas. |
SmartClientWebDriver | focus(By by, boolean clearModifiers, boolean refocus) Set focus into the target element or canvas. |
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. |
int | getElementHeight(By by) Get height of target element |
int | getElementPositionLeft(By by) Get left page offset of target element |
int | getElementPositionTop(By by) Get top page offset of target element |
int | getElementWidth(By by) Get width of target element |
java.lang.String | getEval(java.lang.String javaScript) Simulate Selenium V1's getEval() by evaluating the expression passed in as a series of statements, and returning the value of the last statement as the result. |
java.lang.String | getEval(java.lang.String javaScript, java.lang.String fallbackValue) Simulate Selenium V1's getEval() by evaluating the expression passed in as a series of statements, and returning the value of the last statement as the result. |
java.lang.String | getTable(By scLocator, long row, long col) Returns the specified table cell display value. |
java.lang.String | getText(By by) Returns text of element associated with locator, or the value if there's no associated text. |
java.lang.Object | getValue(By scLocator) Returns value of element associated with locator. |
java.lang.String | getValueAsString(By scLocator) Similar to SmartClientWebDriver.getValue(By) except always returns the value as a String. |
java.lang.String | getValueAsString(By scLocator, boolean asJavaScriptString) Similar to SmartClientWebDriver.getValue(By) except always returns the value as a String. |
SmartClientWebDriver | keyDown(By by, Keys theKey) Send a modifer key down event to the locator target. |
SmartClientWebDriver | keyDown(By by, java.lang.Long charToSend) Send a modifer key down event to the locator target. |
SmartClientWebDriver | keyPress(By by, java.lang.Long charToSend) Sends a single keystroke to the target. |
SmartClientWebDriver | keyPress(By by, java.lang.String keysToSend) Similar to SmartClientWebDriver.sendKeys(By, java.lang.String) to support Selenese conversion. |
SmartClientWebDriver | keyUp(By by, Keys theKey) Send a modifer key up event to the locator target. |
SmartClientWebDriver | keyUp(By by, java.lang.Long charToSend) Send a modifer key up event to the locator target. |
SmartClientWebDriver | mouseMove(By by) Simulate a mouseOver for the locator target. |
SmartClientWebDriver | mouseMoveAt(By by, int xOffset, int yOffset) Simulate a mouseOver at an offset from locator target's left, top corner. |
void | pause(long waitInMillis) Wait for the specified amount of time. |
SmartClientWebDriver | release(By by) Equivalent of our "mouseUp", sent to the locator target. |
SmartClientWebDriver | releaseAt(By by, int xOffset, int yOffset) Equivalent of our "mouseUp", sent to an offset from locator target's left, top corner. |
void | scrollIntoViewIfNeeded(By by) Scroll the target into view if it's not already in view. |
boolean | scrollIntoViewIfNeeded(By by, WebElement element) Scroll the target into view if it's not already in view. |
SmartClientWebDriver | secondClick(By by) Send a second click to the locator target. |
void | selectWindowByName(java.lang.String name) Switch to window specified by name. |
void | selectWindowByTitle(java.lang.String title) Switch to window specified by title. |
boolean | sendData(By by, java.lang.String keysToSend) Similar to SmartClientWebDriver.type(By) except returns whether the element actually got cleared before the new value was typed, and sends a Keys.TAB to the target after typing the value. |
SmartClientWebDriver | sendKeys(By by, java.lang.String keysToSend) Send a sequence of keys to the locator target. |
void | setAllowCoordClickOnOccludingElement(boolean allow) |
void | setAllowJavaScriptToStringMatch(boolean allowJSMatch) Configures whether SmartClientWebDriver checks for a JavaScript match when comparing Strings to values, in addition to performing the check against a Java conversion of the value. |
void | setBaseUrl(java.lang.String baseUrl) Set the Base URL against which tests will run |
void | setCanvasHeightTolerance(long canvasHeightTolerance) Sets primary tolerance for SmartClientWebDriver.verifyCanvasHeight(By, long) . |
java.lang.Object | setCanvasProperty(By scLocator, java.lang.String propertyName, java.lang.Object value) Sets the specified canvas property to the provided value. |
java.lang.Boolean | setCanvasPropertyFalse(By scLocator, java.lang.String propertyName) Sets the specified canvas property false . |
java.lang.Boolean | setCanvasPropertyTrue(By scLocator, java.lang.String propertyName) Sets the specified canvas property true . |
void | setCanvasWidthTolerance(long canvasWidthTolerance) Sets primary tolerance for SmartClientWebDriver.verifyCanvasWidth(By, long) . |
void | setClientLogLevel(java.lang.String category, long level) Sets client log level for a category as number. |
void | setClientLogLevel(java.lang.String category, java.lang.String level) Sets client log level for a category using log priority name. |
void | setDefaultImplicitWait(long implicitWaitMillis) Change the implicit timeout for native WebDriver calls to the supplied number of milliseconds. |
void | setDefaultWaitTimeout(long timeoutInSeconds) Change the default timeout for SmartClientWebDriver waitForXXX() methods to the supplied number of seconds. |
void | setElementTolerance(long elementTolerance) |
void | setMaxDragPause(long maxDragPauseMillis) Change the default maximum pause used by ScActions during dragAndDrop operations. |
void | setOccludedElementApproach(SmartClientWebDriver.OccludedElementApproach occludedApproach) How to click on an occluded WebElement that can't be hit by clicking at the expected coordinates. |
void | setServerLogLevel(java.lang.String category, java.lang.String level) Sets server log level for a category using log priority name. |
void | setUseFrameworkValueAsFallback(boolean useFrameworkValue) Sets whether SmartClientWebDriver.getValue(By) should be called on locators as a fallback if SmartClientWebDriver.getText(By) is not able to find anything (other than the empty string). |
void | setValueTolerance(long valueTolerance) Sets value tolerance for SmartClientWebDriver.verifyValueWithTolerance(By, java.lang.Long) , and fallback tolerance values for SmartClientWebDriver.verifyCanvasWidth(By, long) and SmartClientWebDriver.verifyCanvasHeight(By, long) . |
SmartClientWebDriver | shiftKeyDown() To Support Selenese. |
SmartClientWebDriver | shiftKeyUp() To Support Selenese. |
void | showConsole() Show the developer console. |
SmartClientWebDriver | type(By by) Sends an empty String to the target, clearing it if it's an editable text element. |
SmartClientWebDriver | type(By by, java.lang.Long keyToSend) Alternative to SmartClientWebDriver.sendKeys(By,String) taking a single key as a Long. |
SmartClientWebDriver | type(By by, java.lang.String keysToSend) Clears target if it's an editable text element. |
boolean | verifyCanvasHeight(By scLocator, long expectedHeight) Verify height of target canvas. |
boolean | verifyCanvasWidth(By scLocator, long expectedWidth) Verify width of target canvas. |
boolean | verifyElementClickable(By scLocator) Verify that a given element is clickable. |
boolean | verifyElementHeight(By by, long expectedHeight) Verify that target element height matches expected value |
boolean | verifyElementHeightWithTolerance(By by, long expectedHeight) Verify that target element height matches expected value within tolerance. |
boolean | verifyElementPositionLeft(By by, long expectedLeft) Verify that target element left page offset matches expected value |
boolean | verifyElementPositionTop(By by, long expectedTop) Verify that target element top page offset matches expected value |
boolean | verifyElementPresent(By by) Verify that a given element is present. |
boolean | verifyElementReadyForKeyPresses(By scLocator) Verify that a given element is ready to receive keypresses. |
boolean | verifyElementSelected(By by) Verify that a given element is selected. |
boolean | verifyElementVisible(By by) Verify that a given element is visible. |
boolean | verifyElementWidth(By by, long expectedWidth) Verify that target element width matches expected value |
boolean | verifyElementWidthWithTolerance(By by, long expectedWidth) Verify that target element width matches expected value within tolerance. |
boolean | verifyTable(By scLocator, long row, long col, java.lang.String expected) Verify that specified table cell display value matches the expected String pattern. |
boolean | verifyText(By by) Verify that the element's text is empty. |
boolean | verifyText(By by, java.lang.String expected) Verify that the supplied String pattern matches the element's text. |
boolean | verifyTextPresent(By by, java.lang.String expected) Verify that the supplied String pattern is contained in the element's text. |
boolean | verifyTextPresent(java.lang.String expected) Verify that the supplied String pattern is presnt somewhere on the page. |
boolean | verifyTitle(java.lang.String expected) Verify that the supplied String pattern matches the page title. |
boolean | verifyValue(By scLocator, java.lang.Boolean expected) Verifies that the target has the Boolean value expected. |
boolean | verifyValue(By scLocator, java.lang.Integer expected) Verifies that the target has the Integer value expected. |
boolean | verifyValue(By scLocator, java.lang.Long expected) Verifies that the target has the Long value expected. |
boolean | verifyValue(By scLocator, java.lang.String expected) Verifies that the target matches the String pattern. |
boolean | verifyValueEmpty(By scLocator) Verifies that target's value is empty. |
boolean | verifyValueWithTolerance(By scLocator, java.lang.Integer expected) Verifies that the target has the Integer value expected within tolerance. |
boolean | verifyValueWithTolerance(By scLocator, java.lang.Long expected) Verifies that the target has the Long value expected within tolerance. |
boolean | verifyValueWithTolerance(By scLocator, java.lang.String expected) Verifies that the target matches the String pattern, with any numbers allowed to match literal numbers in the expected String with a tolerance. |
boolean | waitForCanvasDone(By scLocator) Wait until a target Canvas responds positively to the isCanvasDone() call. |
boolean | waitForCanvasDone(By scLocator, long timeoutInSeconds) Wait until a target Canvas responds positively to the isCanvasDone() call. |
boolean | waitForCondition(java.lang.String javaScript) Wait for a javascript expression to evaluate to true. |
boolean | waitForCondition(java.lang.String javaScript, long timeoutInSeconds) Wait for a javascript expression to evaluate to true. |
boolean | waitForCondition(java.lang.String javaScript, long timeoutInSeconds, java.lang.Object[] argument) Wait for a javascript script to execute and return true. |
boolean | waitForElementClickable(By scLocator) Wait until a given element responds positively to the isElementClickable() call. |
boolean | waitForElementClickable(By scLocator, long timeoutInSeconds) Wait until a given element responds positively to the isElementClickable() call. |
boolean | waitForElementInViewport(By scLocator) Wait until a given element has been scrolled into the browser viewport. |
boolean | waitForElementInViewport(By scLocator, long timeoutInSeconds) Wait until a given element has been scrolled into the browser viewport. |
boolean | waitForElementNotClickable(By scLocator) Wait until a given element responds negatively to the isElementClickable() call. |
boolean | waitForElementNotClickable(By scLocator, long timeoutInSeconds) Wait until a given element responds negatively to the isElementClickable() call. |
boolean | waitForElementNotPresent(By by) Wait until a given element is no longer present. |
boolean | waitForElementNotPresent(By by, long timeoutInSeconds) Wait until a given element is no longer present. |
boolean | waitForElementNotVisible(By by) Wait until a given element is no longer visible. |
boolean | waitForElementNotVisible(By by, long timeoutInSeconds) Wait until a given element is no longer visible. |
boolean | waitForElementPresent(By by) Wait until a given element is present. |
boolean | waitForElementPresent(By by, long timeoutInSeconds) Wait until a given element is present. |
boolean | waitForElementReadyForKeyPresses(By scLocator) Wait until a given element responds positively to the isElementReadyForKeyPresses() call. |
boolean | waitForElementReadyForKeyPresses(By scLocator, long timeoutInSeconds) Wait until a given element responds positively to the isElementReadyForKeyPresses() call. |
boolean | waitForElementVisible(By by) Wait until a given element becomes visible. |
boolean | waitForElementVisible(By by, long timeoutInSeconds) Wait until a given element becomes visible. |
boolean | waitForEval(java.lang.String javaScript, java.lang.String expected) Wait for a javascript expression to evaluate to a value that matches the supplied String pattern under the rules described in SmartClientWebDriver.verifyValue(By, java.lang.Boolean) . |
boolean | waitForEval(java.lang.String javaScript, java.lang.String expected, long timeoutInSeconds) Wait for a javascript expression to evaluate to a value that matches the supplied String pattern under the rules described in SmartClientWebDriver.verifyValue(By, java.lang.Boolean) . |
boolean | waitForFormDone(By scLocator) Wait until a target DynamicForm responds positively to the isFormDone() call. |
boolean | waitForFormDone(By scLocator, long timeoutInSeconds) Wait until a target DynamicForm responds positively to the isFormDone() call. |
boolean | waitForFrameToLoad(java.lang.String frameLocator, long timeoutInSeconds) Wait until a frame has loaded. |
boolean | waitForGridDone(By scLocator) Wait until a target ListGrid responds positively to the isGridDone() call. |
boolean | waitForGridDone(By scLocator, java.lang.Boolean includeEdits) Wait until a target ListGrid responds positively to the isGridDone() call. |
boolean | waitForGridDone(By scLocator, java.lang.Boolean includeEdits, long timeoutInSeconds) |
boolean | waitForGridDone(By scLocator, long timeoutInSeconds) Wait until a target ListGrid responds positively to the isGridDone() call. |
boolean | waitForHoverTextPresent(java.lang.String expected) Wait until the hover canvas shows a particular text value. |
boolean | waitForHoverTextPresent(java.lang.String expected, long timeoutInSeconds) Wait until the hover canvas shows a particular text value. |
boolean | waitForItemDone(By scLocator) Wait until a target FormItem responds positively to the isItemDone() call. |
boolean | waitForItemDone(By scLocator, long timeoutInSeconds) Wait until a target FormItem responds positively to the isItemDone() call. |
boolean | waitForSystemDone() Wait until a given element responds positively to the isSystemDone() call. |
boolean | waitForSystemDone(java.lang.Boolean includeRedraws) Wait until a given element responds positively to the isSystemDone() call. |
boolean | waitForSystemDone(java.lang.Boolean includeRedraws, java.lang.Boolean includeEdits) Wait until a given element responds positively to the isSystemDone() call. |
boolean | waitForSystemDone(java.lang.Boolean includeRedraws, java.lang.Boolean includeEdits, long timeoutInSeconds) Wait until a given element responds positively to the isSystemDone() call. |
boolean | waitForSystemDone(long timeoutInSeconds) Wait until a given element responds positively to the isSystemDone() call. |
boolean | waitForSystemDone(java.lang.String includePropList) Wait until a given element responds positively to the isSystemDone() call. |
boolean | waitForSystemDone(java.lang.String includePropList, long timeoutInSeconds) Wait until a given element responds positively to the isSystemDone() call. |
boolean | waitForSystemDone(SystemDoneConfig config) Wait until a given element responds positively to the isSystemDone() call. |
boolean | waitForSystemDone(SystemDoneConfig config, long timeoutInSeconds) Wait until a given element responds positively to the isSystemDone() call. |
boolean | waitForText(By by, java.lang.String expected) Wait until a given element has a particular text value. |
boolean | waitForText(By by, java.lang.String expected, long timeoutInSeconds) Wait until a given element has a particular text value. |
boolean | waitForTileGridDone(By scLocator) Wait until a target TileGrid responds positively to the isTileGridDone() call. |
boolean | waitForTileGridDone(By scLocator, long timeoutInSeconds) Wait until a target TileGrid responds positively to the isTileGridDone() call. |
boolean | waitForTileLayoutDone(By scLocator) Wait until a target TileLayout responds positively to the isTileLayoutDone() call. |
boolean | waitForTileLayoutDone(By scLocator, long timeoutInSeconds) Wait until a target TileLayout responds positively to the isTileLayoutDone() call. |
boolean | waitForValue(By scLocator, java.lang.Object expected) Wait until a target matches the String pattern. |
boolean | waitForValue(By scLocator, java.lang.Object expected, long timeoutInSeconds) Wait until a target matches the String pattern. |
public void setMaxDragPause(long maxDragPauseMillis)
maxDragPauseMillis
- new maximum pause for dragAndDropspublic void setDefaultWaitTimeout(long timeoutInSeconds)
timeoutInSeconds
- new default timeout, in seconds (must be positive)public void setDefaultImplicitWait(long implicitWaitMillis)
implicitWaitMillis
- new implicit timeout, in milliseconds (must be positive)public void setOccludedElementApproach(SmartClientWebDriver.OccludedElementApproach occludedApproach)
WebElement
that can't be hit by clicking at the expected coordinates. In older versions of WebDriver, occlusion didn't matter as much, and the element could still be targeted with a click. In Selenium v3, you're not able to click on an element unless if it has visible points and only at those points. The default is that we attempt to click at the element currently at that point if it's a descendant of the originally targeted element. If it's not, a number of points inside the original's element rect are checked for being the element or its descendants, and the closest descendant nearest the center of the rect is selected.
Note that the W3C (driver-backed) WebDriver (i.e. not legacy mode) requires SmartClientWebDriver to more aggressively check for occlusion, as clicks on occluded elements may silently fail without any exception thrown in W2C WebDriver.
occludedApproach
- specifies approach to take when click() can't reach the targeted element By coordinates@Deprecated public void setAllowCoordClickOnOccludingElement(boolean allow)
SmartClientWebDriver.setOccludedElementApproach(com.isomorphic.webdriver.SmartClientWebDriver.OccludedElementApproach)
WebElement
s. Under WebDriver v3, this method is better avoided in favor of SmartClientWebDriver.setOccludedElementApproach(com.isomorphic.webdriver.SmartClientWebDriver.OccludedElementApproach)
.allow
- sets ELEMENT_AT_POINT if true, otherwise ELEMENT strategypublic void setValueTolerance(long valueTolerance)
SmartClientWebDriver.verifyValueWithTolerance(By, java.lang.Long)
, and fallback tolerance values for SmartClientWebDriver.verifyCanvasWidth(By, long)
and SmartClientWebDriver.verifyCanvasHeight(By, long)
.valueTolerance
- absolute deviation from expected value to allow, inclusivepublic void setElementTolerance(long elementTolerance)
SmartClientWebDriver.verifyElementWidthWithTolerance(By, long)
and SmartClientWebDriver.verifyElementHeightWithTolerance(By, long)
.elementTolerance
- absolute deviation from expected value to allow, inclusivepublic void setCanvasWidthTolerance(long canvasWidthTolerance)
SmartClientWebDriver.verifyCanvasWidth(By, long)
.canvasWidthTolerance
- absolute deviation from expected value to allow, inclusivepublic void setCanvasHeightTolerance(long canvasHeightTolerance)
SmartClientWebDriver.verifyCanvasHeight(By, long)
.canvasHeightTolerance
- absolute deviation from expected value to allow, inclusivepublic void clearTolerances()
public int getElementWidth(By by)
by
- element locatorpublic int getElementHeight(By by)
by
- element locatorpublic int getElementPositionLeft(By by)
by
- element locatorpublic int getElementPositionTop(By by)
by
- element locatorpublic java.lang.Object getValue(By scLocator)
In Junit, for example: verifyEquals(driver.getValue(locator), 1234L)
scLocator
- locator to SmartClient target whose value is desiredpublic java.lang.String getValueAsString(By scLocator)
SmartClientWebDriver.getValue(By)
except always returns the value as a String. Uses JavaScript to perform the conversion. See SmartClientWebDriver.getValueAsString(By, boolean)
.scLocator
- locator to SmartClient target whose value is desiredpublic java.lang.String getValueAsString(By scLocator, boolean asJavaScriptString)
SmartClientWebDriver.getValue(By)
except always returns the value as a String. If asJavaScriptString
is true, the string conversion is done in JavaScript by the browser - otherwise it's done ivia Java toString() APIs. Using JavaScript will produce output closer to Selenese v1 scripts.scLocator
- locator to SmartClient target whose value is desiredasJavaScriptString
- whether to use JavaScript for the toString() conversionpublic void setUseFrameworkValueAsFallback(boolean useFrameworkValue)
SmartClientWebDriver.getValue(By)
should be called on locators as a fallback if SmartClientWebDriver.getText(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(By)
). Default is false.useFrameworkValue
- whether to use the Framework value as the fallbackpublic java.lang.String getText(By by)
SmartClientWebDriver.setUseFrameworkValueAsFallback(boolean)
for details on what value is used.) See note in SmartClientWebDriver.verifyText(By)
for how w deal with the fact that WebDriver doesn't convert newlines to spaces in the same way that Selenium v1 did.
by
- element locatorpublic java.lang.String getTable(By scLocator, long row, long col)
public java.lang.String getEval(java.lang.String javaScript)
javaScript
- statements to evaluatepublic java.lang.String getEval(java.lang.String javaScript, java.lang.String fallbackValue)
If a fallbackValue expression is provided, the entire series of statements will be wrapped in try/catch logic and the fallbackValue will be returned in the event an exception is hit.
javaScript
- statements to evaluatefallbackValue
- value if exception hit (must be an expression)public java.lang.Boolean setCanvasPropertyTrue(By scLocator, java.lang.String propertyName)
true
.scLocator
- canvas locatorpropertyName
- property to setpublic java.lang.Boolean setCanvasPropertyFalse(By scLocator, java.lang.String propertyName)
false
.scLocator
- canvas locatorpropertyName
- property to setpublic java.lang.Boolean clearCanvasProperty(By scLocator, java.lang.String propertyName)
null
.scLocator
- canvas locatorpropertyName
- property to clearpublic java.lang.Object setCanvasProperty(By scLocator, java.lang.String propertyName, java.lang.Object value)
scLocator
- canvas locatorpropertyName
- property to setvalue
- new property valuepublic boolean verifyElementWidth(By by, long expectedWidth)
by
- element locatorexpectedWidth
- width to matchpublic boolean verifyElementHeight(By by, long expectedHeight)
by
- element locatorexpectedHeight
- height to matchpublic boolean verifyElementPositionLeft(By by, long expectedLeft)
by
- element locatorexpectedLeft
- left page offset to matchpublic boolean verifyElementPositionTop(By by, long expectedTop)
by
- element locatorexpectedTop
- top page offset to matchpublic boolean verifyElementPresent(By by)
by
- element locatorpublic boolean verifyElementVisible(By by)
by
- element locatorpublic boolean verifyElementSelected(By by)
by
- element locatorpublic boolean verifyElementClickable(By scLocator)
scLocator
- element locatorpublic boolean verifyElementReadyForKeyPresses(By scLocator)
scLocator
- element locatorpublic boolean verifyCanvasWidth(By scLocator, long expectedWidth)
scLocator
- canvas locatorexpectedWidth
- width to match within tolerancepublic boolean verifyCanvasHeight(By scLocator, long expectedHeight)
scLocator
- canvas locatorexpectedHeight
- height to match within tolerancepublic boolean verifyElementWidthWithTolerance(By by, long expectedWidth)
by
- element locatorexpectedWidth
- width to match within tolerancepublic boolean verifyElementHeightWithTolerance(By by, long expectedHeight)
by
- element locatorexpectedHeight
- height to match within tolerancepublic void setAllowJavaScriptToStringMatch(boolean allowJSMatch)
SmartClientWebDriver
checks for a JavaScript match when comparing Strings to values, in addition to performing the check against a Java conversion of the value. Default is true.allowJSMatch
- whether to check for a JavaScript toString() match toopublic boolean verifyValueEmpty(By scLocator)
null
and the empty String are considered empty, since by convention Selenium v1's verifyEmptyValue() returns true if no element can be found for the locator - and in that case SmartClientWebDriver.getValue(By)
returns null. An empty List
allowCoordClickOnOccludingElement
is true.scLocator
- locator to SmartClient target to checkpublic boolean verifyValue(By scLocator, java.lang.Boolean expected)
Boolean
value expected.scLocator
- locator to SmartClient target to checkexpected
- Boolean to matchpublic boolean verifyValue(By scLocator, java.lang.Long expected)
Long
value expected.scLocator
- locator to SmartClient target to checkexpected
- Long to matchpublic boolean verifyValueWithTolerance(By scLocator, java.lang.Long expected)
Long
value expected within tolerance.scLocator
- locator to SmartClient target to checkexpected
- Long to matchpublic boolean verifyValue(By scLocator, java.lang.Integer expected)
Integer
value expected. Utility method to avoid type casting from Java.scLocator
- locator to SmartClient target to checkexpected
- Integer to matchpublic boolean verifyValueWithTolerance(By scLocator, java.lang.Integer expected)
Integer
value expected within tolerance.scLocator
- locator to SmartClient target to checkexpected
- Integer to matchpublic boolean verifyValue(By scLocator, java.lang.String expected)
String
pattern. Note that the expected String pattern may start with the Selenium v1 specifiers "regex:", "regexp:", "regexi:", "regexpi:", "glob:", and "exact:". As in Selenium v1, "glob:" is the default if no specifier prefix is present, meaning to use globbing.scLocator
- locator to SmartClient target to checkexpected
- pattern value is expected to matchpublic boolean verifyValueWithTolerance(By scLocator, java.lang.String expected)
String
pattern, with any numbers allowed to match literal numbers in the expected String with a tolerance. So for example, an expected String of "10, 20" will match a JavaScript array value of [12, 19] if a valueTolerance
of 10 is in use and JavaScript String matching mode
is active. Note that the expected String pattern may start with the Selenium v1 specifiers "regex:", "regexp:", "regexi:", "regexpi:", "glob:", and "exact:". As in Selenium v1, "glob:" is the default if no specifier prefix is present, meaning to use globbing.
scLocator
- locator to SmartClient target to checkexpected
- numbers to match with a tolerance, or String matching patternpublic boolean verifyTextPresent(java.lang.String expected)
expected
- String pattern to match against text on pagepublic boolean verifyText(By by)
by
- element locatorpublic boolean verifyText(By by, java.lang.String expected)
by
- element locatorexpected
- String pattern to match against the element's text.public boolean verifyTextPresent(By by, java.lang.String expected)
by
- element locatorexpected
- String pattern that should be contained by the element's text.public boolean verifyTitle(java.lang.String expected)
expected
- String pattern to match against the page title.public boolean verifyTable(By scLocator, long row, long col, java.lang.String expected)
SmartClientWebDriver.verifyValue(By,String)
are supported.scLocator
- cell locatorrow
- target cell rowcol
- target cell colexpected
- String pattern to match against the cell display valuepublic boolean assertEval(java.lang.String javaScript)
SmartClientWebDriver.assertEval(String,String,boolean)
.javaScript
- script to runpublic boolean assertEval(java.lang.String javaScript, java.lang.Object expected)
SmartClientWebDriver.assertEval(String,String,boolean)
.javaScript
- script to runexpected
- pattern to match against value of scriptpublic boolean assertEval(java.lang.String javaScript, java.lang.Object expected, boolean asJavaScriptString)
SmartClientWebDriver.assertEval(String,String,boolean)
.javaScript
- script to runexpected
- pattern to match against value of scriptasJavaScriptString
- whether to convert the result to a String in JavaScript before returning to Java; (e.g. [1,2] will become "1,2")public boolean assertEval(java.lang.String javaScript, java.lang.String expected)
SmartClientWebDriver.assertEval(String,String,boolean)
.javaScript
- script to runexpected
- pattern to match against value of scriptpublic boolean assertEval(java.lang.String javaScript, java.lang.String expected, boolean asJavaScriptString)
SmartClientWebDriver.executeScript(java.lang.String, java.lang.Object[])
. (This is for back compatibility with Selenium v1.) Note that assertEval
is similar to SmartClientWebDriver.waitForEval(java.lang.String, java.lang.String)
except that the comparison is made immediately and no waiting ever occurs.
javaScript
- script to runexpected
- pattern to match against value of scriptasJavaScriptString
- whether to convert the result to a String in JavaScript before returning to Java; (e.g. [1,2] will become "1,2")public boolean waitForElementClickable(By scLocator)
scLocator
- element locatorSmartClientWebDriver.setDefaultWaitTimeout(long)
public boolean waitForElementClickable(By scLocator, long timeoutInSeconds)
scLocator
- element locatortimeoutInSeconds
- seconds to wait (ignored if non-positive - default used)public boolean waitForElementNotClickable(By scLocator)
scLocator
- element locatorSmartClientWebDriver.setDefaultWaitTimeout(long)
public boolean waitForElementNotClickable(By scLocator, long timeoutInSeconds)
scLocator
- element locatortimeoutInSeconds
- seconds to wait (ignored if non-negative - default used)public boolean waitForElementVisible(By by)
by
- element locatorSmartClientWebDriver.setDefaultWaitTimeout(long)
public boolean waitForElementVisible(By by, long timeoutInSeconds)
by
- element locatortimeoutInSeconds
- seconds to wait (ignored if non-positive - default used)public boolean waitForElementPresent(By by)
by
- target elementpublic boolean waitForElementPresent(By by, long timeoutInSeconds)
by
- target elementtimeoutInSeconds
- seconds to wait (ignored if non-positive - default used)public boolean waitForElementNotPresent(By by)
by
- target elementpublic boolean waitForElementNotPresent(By by, long timeoutInSeconds)
by
- target elementtimeoutInSeconds
- seconds to wait (ignored if non-positive - default used)public boolean waitForElementNotVisible(By by)
by
- element locatorSmartClientWebDriver.setDefaultWaitTimeout(long)
public boolean waitForElementNotVisible(By by, long timeoutInSeconds)
by
- element locatortimeoutInSeconds
- seconds to wait (ignored if non-positive - default used)public boolean waitForElementReadyForKeyPresses(By scLocator)
scLocator
- target elementpublic boolean waitForElementReadyForKeyPresses(By scLocator, long timeoutInSeconds)
scLocator
- target elementtimeoutInSeconds
- seconds to wait (ignored if non-positive - default used)public boolean waitForElementInViewport(By scLocator)
scLocator
- target elementpublic boolean waitForElementInViewport(By scLocator, long timeoutInSeconds)
scLocator
- target elementtimeoutInSeconds
- seconds to wait (ignored if non-positive - default used)public boolean waitForCanvasDone(By scLocator)
Canvas
responds positively to the isCanvasDone() call.scLocator
- target canvaspublic boolean waitForCanvasDone(By scLocator, long timeoutInSeconds)
Canvas
responds positively to the isCanvasDone() call.scLocator
- target canvastimeoutInSeconds
- seconds to wait (ignored if non-positive - default used)public boolean waitForGridDone(By scLocator)
ListGrid
responds positively to the isGridDone() call.scLocator
- target gridpublic boolean waitForGridDone(By scLocator, long timeoutInSeconds)
ListGrid
responds positively to the isGridDone() call.scLocator
- target gridtimeoutInSeconds
- seconds to wait (ignored if non-positive - default used)public boolean waitForGridDone(By scLocator, java.lang.Boolean includeEdits)
ListGrid
responds positively to the isGridDone() call.scLocator
- target gridincludeEdits
- whether to check for pending (unsaved) editspublic boolean waitForGridDone(By scLocator, java.lang.Boolean includeEdits, long timeoutInSeconds)
SmartClientWebDriver.waitForGridDone(By)
. Wait until a target ListGrid
responds positively to the isGridDone() call.scLocator
- target gridincludeEdits
- whether to check for pending (unsaved) editstimeoutInSeconds
- seconds to wait (ignored if non-positive - default used)public boolean waitForTileGridDone(By scLocator)
TileGrid
responds positively to the isTileGridDone() call.scLocator
- target gridpublic boolean waitForTileGridDone(By scLocator, long timeoutInSeconds)
TileGrid
responds positively to the isTileGridDone() call.scLocator
- target gridtimeoutInSeconds
- seconds to wait (ignored if non-positive - default used)public boolean waitForTileLayoutDone(By scLocator)
TileLayout
responds positively to the isTileLayoutDone() call.scLocator
- target tileLayoutpublic boolean waitForTileLayoutDone(By scLocator, long timeoutInSeconds)
TileLayout
responds positively to the isTileLayoutDone() call.scLocator
- target tileLayouttimeoutInSeconds
- seconds to wait (ignored if non-positive - default used)public boolean waitForFormDone(By scLocator)
DynamicForm
responds positively to the isFormDone() call.scLocator
- target formpublic boolean waitForFormDone(By scLocator, long timeoutInSeconds)
DynamicForm
responds positively to the isFormDone() call.scLocator
- target formtimeoutInSeconds
- seconds to wait (ignored if non-positive - default used)public boolean waitForItemDone(By scLocator)
FormItem
responds positively to the isItemDone() call.scLocator
- target itempublic boolean waitForItemDone(By scLocator, long timeoutInSeconds)
FormItem
responds positively to the isItemDone() call.scLocator
- target itemtimeoutInSeconds
- seconds to wait (ignored if non-positive - default used)public boolean waitForSystemDone()
public boolean waitForSystemDone(long timeoutInSeconds)
timeoutInSeconds
- seconds to wait (ignored if non-positive - default used)public boolean waitForSystemDone(java.lang.Boolean includeRedraws)
includeRedraws
- whether to check for pending redrawspublic boolean waitForSystemDone(java.lang.Boolean includeRedraws, java.lang.Boolean includeEdits)
includeRedraws
- whether to check for pending redrawsincludeEdits
- whether to check for pending (unsaved) editspublic boolean waitForSystemDone(java.lang.Boolean includeRedraws, java.lang.Boolean includeEdits, long timeoutInSeconds)
includeRedraws
- whether to check for pending redrawsincludeEdits
- whether to check for pending (unsaved) editstimeoutInSeconds
- seconds to wait (ignored if non-positive - default used)public boolean waitForSystemDone(java.lang.String includePropList)
includePropList
- controls what to check when looking at whether system is "done" specified as a comma-separated list of properties to includepublic boolean waitForSystemDone(java.lang.String includePropList, long timeoutInSeconds)
includePropList
- controls what to check when looking at whether system is "done" specified as a comma-separated list of properties to includetimeoutInSeconds
- seconds to wait (ignored if non-positive - default used)public boolean waitForSystemDone(SystemDoneConfig config)
config
- controls what to check when looking at whether system is "done"public boolean waitForSystemDone(SystemDoneConfig config, long timeoutInSeconds)
config
- controls what to check when looking at whether system is "done"timeoutInSeconds
- seconds to wait (ignored if non-positive - default used)public boolean waitForText(By by, java.lang.String expected)
SmartClientWebDriver.verifyText(By)
.by
- target elementexpected
- String pattern to match against the element's text.public boolean waitForText(By by, java.lang.String expected, long timeoutInSeconds)
SmartClientWebDriver.verifyText(By)
.by
- target elementexpected
- String pattern to match against the element's text.timeoutInSeconds
- seconds to wait (ignored if non-positive - default used)public boolean waitForHoverTextPresent(java.lang.String expected)
SmartClientWebDriver.verifyText(By)
. See SmartClientWebDriver.waitForHoverTextPresent(String,long)
.expected
- String pattern to match against the hover canvas' contentspublic boolean waitForHoverTextPresent(java.lang.String expected, long timeoutInSeconds)
SmartClientWebDriver.verifyText(By)
. Note that for backward compatibilty, this API assumes the pattern is a regex, but you can override that as specified in the documentation for SmartClientWebDriver.verifyValue(By, java.lang.Boolean)
.expected
- String pattern to match against the hover canvas' contentstimeoutInSeconds
- seconds to wait (ignored if non-positive - default used)public boolean waitForValue(By scLocator, java.lang.Object expected)
String
pattern. See SmartClientWebDriver.verifyValue(By, java.lang.Boolean)
.scLocator
- locator to SmartClient target to checkexpected
- pattern value is expected to matchpublic boolean waitForValue(By scLocator, java.lang.Object expected, long timeoutInSeconds)
String
pattern. See SmartClientWebDriver.verifyValue(By, java.lang.Boolean)
.scLocator
- locator to SmartClient target to checkexpected
- pattern value is expected to matchtimeoutInSeconds
- seconds to wait (ignored if non-positive - default used)public boolean waitForCondition(java.lang.String javaScript)
SmartClientWebDriver.waitForCondition(String,long)
.javaScript
- script to runpublic boolean waitForCondition(java.lang.String javaScript, long timeoutInSeconds)
javaScript
- script to runtimeoutInSeconds
- seconds to wait (ignored if non-positive - default used)public boolean waitForCondition(java.lang.String javaScript, long timeoutInSeconds, java.lang.Object[] argument)
You may pass one or more arguments to this variant, and they're referenced just as in native calls to the WebDriver JavascriptExecutor (e.g. "arguments[0]").
javaScript
- script to runargument
- object to pass as argument to scripttimeoutInSeconds
- seconds to wait (ignored if non-positive - default used)public boolean waitForEval(java.lang.String javaScript, java.lang.String expected)
SmartClientWebDriver.verifyValue(By, java.lang.Boolean)
. See SmartClientWebDriver.waitForEval(String,String,long)
.javaScript
- script to runexpected
- pattern to match against value of scriptpublic boolean waitForEval(java.lang.String javaScript, java.lang.String expected, long timeoutInSeconds)
SmartClientWebDriver.verifyValue(By, java.lang.Boolean)
. Script should be in Selenium v1 format - a sequence of statements, with the last statement being a valid expression. That expression will be the value of the script - the script should contain no return statement.javaScript
- script to runexpected
- pattern to match against value of scripttimeoutInSeconds
- seconds to wait (ignored if non-positive - default used)public boolean waitForFrameToLoad(java.lang.String frameLocator, long timeoutInSeconds)
frameLocator
- locatortimeoutInSeconds
- seconds to waitpublic void setBaseUrl(java.lang.String baseUrl)
baseUrl
- new base URLpublic 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 pause(long waitInMillis)
waitInMillis
- amount of time, in milliseconds, to waitpublic void selectWindowByName(java.lang.String name)
name
- name of window to switch topublic void selectWindowByTitle(java.lang.String title)
title
- title of window to switch topublic void scrollIntoViewIfNeeded(By by)
SmartClientWebDriver.scrollIntoViewIfNeeded(By,WebElement)
.by
- target locatorpublic boolean scrollIntoViewIfNeeded(By by, WebElement element)
by
- target locatorelement
- target element (only used in non-ByScLocator case)public SmartClientWebDriver click(By by)
by
- target element or widget - if null then the previous elementpublic SmartClientWebDriver secondClick(By by)
by
- target element or widget - if null then the previous elementpublic SmartClientWebDriver doubleClick(By by)
SmartClientWebDriver.click(By)
and then SmartClientWebDriver.secondClick(By)
.by
- target element or widget - if null then the previous elementpublic SmartClientWebDriver clickAndHold(By by)
by
- target element or widget - if null then the previous elementpublic SmartClientWebDriver clickAndHoldAt(By by, int xOffset, int yOffset)
by
- target element or widget - if null then the previous elementxOffset
- horizontal offset from target's left edgeyOffset
- vertical offset from target's top edgepublic SmartClientWebDriver release(By by)
by
- target element or widget - if null then the previous elementpublic SmartClientWebDriver releaseAt(By by, int xOffset, int yOffset)
by
- target element or widget - if null then the previous elementxOffset
- horizontal offset from target's left edgeyOffset
- vertical offset from target's top edgepublic SmartClientWebDriver contextClick(By by)
by
- target element or widget - if null then the previous elementpublic SmartClientWebDriver mouseMove(By by)
by
- target element or widget - if null then the previous elementpublic SmartClientWebDriver mouseMoveAt(By by, int xOffset, int yOffset)
by
- target element or widget - if null then the previous elementxOffset
- horizontal offset from target's left edgeyOffset
- vertical offset from target's top edgepublic SmartClientWebDriver dragAndDrop(By sourceBy, By targetBy)
sourceBy
- Indicates the element to drag. If null then the previous element.targetBy
- The destinationpublic SmartClientWebDriver dragAndDrop(By sourceBy, java.lang.String offset)
SmartClientWebDriver.dragAndDropBy(By,int,int)
instead.sourceBy
- Indicates the element to drag. If null then the previous element.offset
- Selenese compatible string arg. Eg: "-70,+0"public SmartClientWebDriver dragAndDropBy(By sourceBy, int xOffset, int yOffset)
sourceBy
- Indicates the element to drag. If null then the previous element.public SmartClientWebDriver sendKeys(By by, java.lang.String keysToSend)
by
- Indicates the target of keystrokes. If null then the previous element.keysToSend
- the String of keys to sendpublic SmartClientWebDriver type(By by)
SmartClientWebDriver.sendKeys(By, java.lang.String)
to support Selenese conversion.by
- Indicates the target of keystrokes. If null then the previous element.public SmartClientWebDriver type(By by, java.lang.String keysToSend)
SmartClientWebDriver.sendKeys(By, java.lang.String)
to support selenese conversion.by
- Indicates the target of keystrokes. If null then the previous element.keysToSend
- keys to sendpublic SmartClientWebDriver type(By by, java.lang.Long keyToSend)
SmartClientWebDriver.sendKeys(By,String)
taking a single key as a Long.by
- Indicates the target of keystrokes. If null then the previous element.keyToSend
- Long to send as textpublic boolean sendData(By by, java.lang.String keysToSend)
SmartClientWebDriver.type(By)
except returns whether the element actually got cleared before the new value was typed, and sends a Keys.TAB to the target after typing the value.by
- Indicates the target of keystrokes. If null then the previous element.keysToSend
- keys to sendpublic SmartClientWebDriver keyPress(By by, java.lang.Long charToSend)
by
- target of keystrokes (currently ignored)charToSend
- Javascript key code for a modifier keypublic SmartClientWebDriver keyPress(By by, java.lang.String keysToSend)
SmartClientWebDriver.sendKeys(By, java.lang.String)
to support Selenese conversion.by
- target of keystrokes (currently ignored)keysToSend
- keys to sendpublic SmartClientWebDriver keyDown(By by, java.lang.Long charToSend)
by
- target of keystrokes (currently ignored except for ENTER)charToSend
- Javascript key code for a modifier keypublic SmartClientWebDriver keyUp(By by, java.lang.Long charToSend)
by
- target of keystrokes (currently ignored)charToSend
- Javascript key code for a modifier keypublic SmartClientWebDriver keyDown(By by, Keys theKey)
by
- Indicates the target of keystrokes. If null then the previous element.theKey
- modifier keypublic SmartClientWebDriver keyUp(By by, Keys theKey)
by
- Indicates the target of keystrokes. If null then the previous element.theKey
- modifier keypublic SmartClientWebDriver shiftKeyDown()
public SmartClientWebDriver shiftKeyUp()
public SmartClientWebDriver controlKeyDown()
public SmartClientWebDriver controlKeyUp()
public SmartClientWebDriver focus(By by)
by
- focus targetpublic SmartClientWebDriver focus(By by, boolean clearModifiers)
by
- focus targetclearModifiers
- whether to attempt to clear "stuck" modifier keyspublic SmartClientWebDriver focus(By by, boolean clearModifiers, boolean refocus)
by
- focus targetclearModifiers
- whether to attempt to clear "stuck" modifier keysrefocus
- whether to refocus instead of no-oping if focus target already has focuspublic SmartClientWebDriver blur(By by)
by
- blur targetpublic void showConsole()
public void setClientLogLevel(java.lang.String category, long level)
category
- logging categorylevel
- numerical logging level to setpublic void setClientLogLevel(java.lang.String category, java.lang.String level)
category
- logging categorylevel
- named logging level to setpublic void setServerLogLevel(java.lang.String category, java.lang.String level)
category
- logging categorylevel
- named logging level to set