Package io.fluentlenium.core.script
Class FluentJavascript
java.lang.Object
io.fluentlenium.core.script.FluentJavascript
Execute a script and map it's result.
- See Also:
-
JavascriptExecutor.executeScript(java.lang.String, java.lang.Object...)
-
Constructor Summary
ConstructorDescriptionFluentJavascript
(org.openqa.selenium.JavascriptExecutor executor, boolean async, String script, Object... args) Creates a new fluent javascript. -
Method Summary
Modifier and TypeMethodDescriptionRetrieve the result as aBoolean
.Retrieve the result as aDouble
.List<?>
Retrieve the result as aList
.<T> List<T>
getListResult
(Class<T> listType) Retrieve the result as a typedList
Retrieve the result as aLong
.Retrieve the result of the script execution.Retrieve the result as aString
.boolean
Check if the result is aBoolean
.boolean
Check if the result is aDouble
.boolean
Check if the result is aList
.boolean
Check if the result is aLong
.boolean
Check if the result is aString
.
-
Constructor Details
-
FluentJavascript
public FluentJavascript(org.openqa.selenium.JavascriptExecutor executor, boolean async, String script, Object... args) Creates a new fluent javascript.- Parameters:
executor
- underlying javascript executorasync
- if true, scripts will be executed asynchronously, else it will be executed synchronouslyscript
- script source to executeargs
- script arguments
-
-
Method Details
-
isStringResult
public boolean isStringResult()Check if the result is aString
.- Returns:
- true if the result of javascript execution can be retrieved as a
String
- See Also:
-
JavascriptExecutor.executeScript(java.lang.String, java.lang.Object...)
-
isBooleanResult
public boolean isBooleanResult()Check if the result is aBoolean
.- Returns:
- true if the result of javascript execution can be retrieved as a
Boolean
- See Also:
-
JavascriptExecutor.executeScript(java.lang.String, java.lang.Object...)
-
isDoubleResult
public boolean isDoubleResult()Check if the result is aDouble
.- Returns:
- true if the result of javascript execution can be retrieved as a
Double
- See Also:
-
JavascriptExecutor.executeScript(java.lang.String, java.lang.Object...)
-
isLongResult
public boolean isLongResult()Check if the result is aLong
.- Returns:
- true if the result of javascript execution can be retrieved as a
Long
- See Also:
-
JavascriptExecutor.executeScript(java.lang.String, java.lang.Object...)
-
isListResult
public boolean isListResult()Check if the result is aList
.- Returns:
- true if the result of javascript execution can be retrieved as a
List
- See Also:
-
JavascriptExecutor.executeScript(java.lang.String, java.lang.Object...)
-
getResult
Retrieve the result of the script execution.- Returns:
- the result.
- See Also:
-
JavascriptExecutor.executeScript(java.lang.String, java.lang.Object...)
-
getDoubleResult
Retrieve the result as aDouble
.- Returns:
- the result of script execution cast as a
Double
- See Also:
-
JavascriptExecutor.executeScript(java.lang.String, java.lang.Object...)
-
getBooleanResult
Retrieve the result as aBoolean
.- Returns:
- the result of script execution cast as a
Boolean
- See Also:
-
JavascriptExecutor.executeScript(java.lang.String, java.lang.Object...)
-
getLongResult
Retrieve the result as aLong
.- Returns:
- the result of script execution cast as a
Long
- See Also:
-
JavascriptExecutor.executeScript(java.lang.String, java.lang.Object...)
-
getStringResult
Retrieve the result as aString
.- Returns:
- the result of script execution cast as a
String
- See Also:
-
JavascriptExecutor.executeScript(java.lang.String, java.lang.Object...)
-
getListResult
Retrieve the result as aList
.- Returns:
- result of javascript script cast as a
List
- See Also:
-
JavascriptExecutor.executeScript(java.lang.String, java.lang.Object...)
-
getListResult
Retrieve the result as a typedList
- Type Parameters:
T
- type of list elements- Parameters:
listType
- class of list elements- Returns:
- the result of javascript execution cast as a a typed
List
- See Also:
-
JavascriptExecutor.executeScript(java.lang.String, java.lang.Object...)
-