public abstract class AbstractEcmascriptService extends AbstractService implements EcmascriptDebugger
| Modifier and Type | Field and Description |
|---|---|
protected int |
activeWindowId
The window our current runtime is contained in.
|
protected String |
currentFramePath
The frame our current runtime is contained in.
|
protected OperaDriver |
driver |
protected int |
retries
The number of times we've attempted to retrieve a response from an injected JavaScript sent to
the browser.
|
protected RuntimeNode |
root |
protected long |
sleepDuration
Defines for how long to sleep when retrying to execute a JS command.
|
protected WindowManager |
windowManager
The window manager we are using.
|
servicesSERVICE_NAME| Constructor and Description |
|---|
AbstractEcmascriptService(ScopeServices services,
String name) |
AbstractEcmascriptService(ScopeServices services,
String name,
String requiredVersion) |
| Modifier and Type | Method and Description |
|---|---|
protected String |
buildEvalString(List<org.openqa.selenium.WebElement> elements,
String script,
Object... params)
Build the script to send with arguments.
|
void |
cleanUpRuntimes()
Cleanup runtimes with the active window id
|
String |
executeJavascript(String using)
Execute a script and wait for response
|
String |
executeJavascript(String using,
boolean responseExpected)
Execute a script, this method allows fine tuning of responses, we are not interested in return
value in some injections
|
protected boolean |
isNumber(String name) |
boolean |
isScriptInjectable()
Queries the current runtime to see if it's script injectable.
|
protected Object |
parseNumber(String value) |
protected void |
processArgument(Object object,
StringBuilder builder,
List<org.openqa.selenium.WebElement> elements) |
protected void |
recover() |
protected void |
resetCounters()
Reset the timeout and retries.
|
void |
setDriver(OperaDriver driver)
Set the driver this service belongs to.
|
buildPayload, executeMessage, executeMessage, executeMessage, getServiceName, getServiceVersion, isVersionInRange, sleep, toString, xpathIterator, xpathPointerclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddRuntime, callFunctionOnObject, callFunctionOnObject, changeRuntime, changeRuntime, cleanUpRuntimes, examineObjects, examineScriptResult, executeJavascript, executeScript, executeScriptOnObject, getObject, getRuntimeId, listFramePaths, readyStateChanged, releaseObject, releaseObjects, removeRuntime, resetFramePath, resetRuntimesList, scriptExecutor, setFormElementValue, setRuntime, updateRuntimegetServiceName, getServiceVersion, initprotected int retries
protected long sleepDuration
OperaIntervals.SCRIPT_RETRY_INTERVAL.protected WindowManager windowManager
protected String currentFramePath
protected int activeWindowId
protected OperaDriver driver
protected RuntimeNode root
public AbstractEcmascriptService(ScopeServices services, String name)
public AbstractEcmascriptService(ScopeServices services, String name, String requiredVersion)
public void setDriver(OperaDriver driver)
Debuggerprotected void resetCounters()
OperaIntervals.SCRIPT_RETRY_INTERVAL as
the default value of the sleep interval sleepDuration.protected String buildEvalString(List<org.openqa.selenium.WebElement> elements, String script, Object... params)
elements - the web elements to send with the script as argumentscript - the script to execute, can have references to argument(s)params - params to send with the script, will be parsed in to argumentsprotected void processArgument(Object object, StringBuilder builder, List<org.openqa.selenium.WebElement> elements)
public String executeJavascript(String using)
DebuggerexecuteJavascript in interface Debuggerusing - script to executepublic String executeJavascript(String using, boolean responseExpected)
DebuggerexecuteJavascript in interface Debuggerusing - script to executeresponseExpected - if true parse the responseprotected void recover()
protected boolean isNumber(String name)
public void cleanUpRuntimes()
DebuggercleanUpRuntimes in interface Debuggerpublic boolean isScriptInjectable()
DebuggerisScriptInjectable in interface DebuggerCopyright © 2012. All Rights Reserved.