net.thucydides.core.webdriver.javascript
Class JavascriptExecutorFacade

Package class diagram package JavascriptExecutorFacade
java.lang.Object
  extended by net.thucydides.core.webdriver.javascript.JavascriptExecutorFacade

public class JavascriptExecutorFacade
extends Object

Simple encapsulation of Javascript execution.


Constructor Summary
JavascriptExecutorFacade(org.openqa.selenium.WebDriver driver)
           
 
Method Summary
<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(Class<T> classOfT, String script, Object... params)
          Executes the JavaScript code and deserializes the resulting object as a List of classOfT.
 Object executeScript(String script)
          Execute some Javascript in the underlying WebDriver driver.
 Object executeScript(String script, Object... params)
           
 JavascriptExecutorFacade withInjectableValues(com.fasterxml.jackson.databind.InjectableValues inject)
           
 JavascriptExecutorFacade withObjectMapper(com.fasterxml.jackson.databind.ObjectMapper mapper)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JavascriptExecutorFacade

public JavascriptExecutorFacade(org.openqa.selenium.WebDriver driver)
Method Detail

withObjectMapper

public JavascriptExecutorFacade withObjectMapper(com.fasterxml.jackson.databind.ObjectMapper mapper)

withInjectableValues

public JavascriptExecutorFacade withInjectableValues(com.fasterxml.jackson.databind.InjectableValues inject)

executeScript

public Object executeScript(String script)
Execute some Javascript in the underlying WebDriver driver.

Parameters:
script -
Returns:

executeScript

public Object executeScript(String script,
                            Object... params)

deserializeScriptResultAs

public <T> T deserializeScriptResultAs(Class<T> classOfT,
                                       String script,
                                       Object... params)
Executes the JavaScript code and deserializes the resulting object as a classOfT.

Parameters:
classOfT - Java Class
script - that returns JavaScript Object
params - for the script
Returns:
deserialized as classOfT object

deserializeScriptResultAsListOf

public <T> List<T> deserializeScriptResultAsListOf(Class<T> classOfT,
                                                   String script,
                                                   Object... params)
Executes the JavaScript code and deserializes the resulting object as a List of classOfT.

Parameters:
classOfT - Java Class to reflect on
script - that returns JavaScript Object
script - params
Returns:
deserialized as List of classOfT


Copyright © 2011-2013 Wakaleo Consulting. All Rights Reserved.