|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface PageElementJavascript
Encapsulates Javascript functionality of the
PageElement.
PageElement.isPresent() of the corresponding page element must return true
before any of the methods of this interface are invoked, otherwise NoSuchElementException
will be raised.
| Method Summary | ||
|---|---|---|
|
execute(Class<T> resultType,
String script,
Object... arguments)
Provides the same functionality as execute(String, Object...), but lets the client specify the
expected result type. |
|
Object |
execute(String script,
Object... arguments)
Executes custom script on this element. |
|
|
executeAsync(Class<T> resultType,
String script,
Object... arguments)
Provides the same functionality as executeAsync(Class, String, Object...), but lets the client specify
the expected result type. |
|
Object |
executeAsync(String script,
Object... arguments)
Executes custom script on this element asynchronously. |
|
|
executeTimed(Class<T> resultType,
String script,
Object... arguments)
Executes custom script on this element in a periodic manner, allowing the client to wait for a particular expected result to occur (via the returned TimedQuery). |
|
PageElementFormJavascript |
form()
Access to form events for the associated page element. |
|
PageElementMouseJavascript |
mouse()
Access to mouse events for the associated page element. |
|
| Method Detail |
|---|
PageElementMouseJavascript mouse()
PageElementFormJavascript form()
Object execute(String script,
Object... arguments)
JavascriptExecutor.executeScript(String, Object...).
The arguments and return type are as in
JavascriptExecutor.executeScript(String, Object...) with addition of
PageElements as valid argument type.
When a DOM element is returned from the script, a corresponding
PageElement
instance will be returned from this method
script - javascript to executearguments - custom arguments to the script. a number, a boolean, a String,
a PageElement, a WebElement or a List of
any combination of the above
PageElement,
or null.
NullPointerException - if script is nullJavascriptExecutor.executeScript(String, Object...)
<T> T execute(Class<T> resultType,
String script,
Object... arguments)
execute(String, Object...), but lets the client specify the
expected result type. The expected result type must not be null and must match the actual
result from the executed script.
resultType - expected type of the result. One of Boolean, Long, String, List or
PageElement . Must not be nullscript - javascript to executearguments - custom arguments to the script. a number, a boolean, a String,
a PageElement, a WebElement or a List of
any combination of the above
NullPointerException - if script or resultType is null
IllegalArgumentException - if resultType is not one of the expected types
ClassCastException - if the actual result type does not match resultTypeexecute(String, Object...)
<T> TimedQuery<T> executeTimed(Class<T> resultType,
String script,
Object... arguments)
TimedQuery).
All rules (in particular with regards to the result type) of execute(String, Object...) apply to this
method.
The caller must provide the expected return type as resultType. It must be one of the valid result types
or an exception will be raised.
resultType - expected type of the result. One of Boolean, Long, String or List. Must not be nullscript - javascript to executearguments - custom arguments to the script. a number, a boolean, a String,
a PageElement, a WebElement or a List of
any combination of the above
TimedQuery to query for the expected result
NullPointerException - if script or resultType is null
IllegalArgumentException - if resultType is not one of the expected types
ClassCastException - if the actual result type does not match resultTypeJavascriptExecutor.executeScript(String, Object...),
execute(String, Object...)
Object executeAsync(String script,
Object... arguments)
execute(String, Object...) apply, except the last argument in the
'arguments' magic variable in the script is a callback that has to be invoked and given result of the script
so that this method returns. See JavascriptExecutor.executeAsyncScript(String, Object...)
for details.
Consider using executeTimed(Class, String, Object...) instead.
script - javascript to executearguments - custom arguments to the script. a number, a boolean, a String,
a PageElement, a WebElement or a List of
any combination of the above
PageElement. Or null.
NullPointerException - if script is null(String, Object...),
execute(String, Object...)
<T> T executeAsync(Class<T> resultType,
String script,
Object... arguments)
executeAsync(Class, String, Object...), but lets the client specify
the expected result type. The expected result type must not be null and must match the actual
result from the executed script.
Consider using executeTimed(Class, String, Object...) instead.
resultType - expected type of the result. One of Boolean, Long, String, List or
PageElement . Must not be nullscript - javascript to executearguments - custom arguments to the script. a number, a boolean, a String,
a PageElement, a WebElement or a List of
any combination of the above
NullPointerException - if script or resultType is null
IllegalArgumentException - if resultType is not one of the expected types
ClassCastException - if the actual result type does not match resultType(String, Object...)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||