public class JavascriptExecutorFacade extends Object
| Constructor and Description |
|---|
JavascriptExecutorFacade() |
JavascriptExecutorFacade(org.openqa.selenium.WebDriver driver) |
| Modifier and Type | Method and Description |
|---|---|
<T> T |
deserializeScriptResultAs(Class<T> classOfT,
String script,
Map<String,Object> injectedFields,
Object... params) |
<T> T |
deserializeScriptResultAs(Class<T> classOfT,
String script,
Object... params)
Executes the JavaScript code and deserializes the resulting object as a classOfT.
|
<T> List<T> |
deserializeScriptResultAsListOf(String script,
Object... params)
Executes the JavaScript code and deserializes the resulting object as a List.
|
Object |
executeAsyncScript(String script) |
Object |
executeAsyncScript(String script,
Object... params) |
Object |
executeScript(String script)
Execute some Javascript in the underlying WebDriver driver.
|
Object |
executeScript(String script,
Object... params) |
protected com.google.gson.Gson |
getGson() |
void |
registerTypeAdapter(Type type,
Object typeAdapter)
Register a GSon type adaptor to use during the JSON deserialization
|
public JavascriptExecutorFacade(org.openqa.selenium.WebDriver driver)
public JavascriptExecutorFacade()
protected com.google.gson.Gson getGson()
public void registerTypeAdapter(Type type, Object typeAdapter)
type - typeAdapter - public Object executeScript(String script)
script - public <T> T deserializeScriptResultAs(Class<T> classOfT, String script, Map<String,Object> injectedFields, Object... params) throws IllegalAccessException
IllegalAccessExceptionpublic <T> T deserializeScriptResultAs(Class<T> classOfT, String script, Object... params) throws IllegalAccessException
classOfT - Java Classscript - that returns JavaScript Objectparams - a map of parameters to inject into the deserialized objectIllegalAccessExceptionCopyright © 2022. All rights reserved.