public interface Debugger extends Service
| Modifier and Type | Method and Description |
|---|---|
void |
addRuntime(EsdbgProtos.RuntimeInfo info)
Adds a runtime to the list of runtimes maintained in the service (STP/1 only)
|
String |
callFunctionOnObject(String using,
int objectId)
The script to be executed on/using an object
|
Object |
callFunctionOnObject(String using,
int objectId,
boolean responseExpected) |
void |
changeRuntime(int index)
Changes the frame by index
|
void |
changeRuntime(String frameName)
Changes the frame by frame name address nested frames by dot (first.second)
|
void |
cleanUpRuntimes()
Cleanup runtimes with the active window id
|
void |
cleanUpRuntimes(int windowId)
Cleanup possible dead/suspended runtimes on runtime-started or window-closed
|
List<Integer> |
examineObjects(Integer id)
Request additional information about an object, such as its prototype or its properties.
|
Object |
examineScriptResult(Integer id)
Recursively iterates through the property hierarchies of underneath the given object and
unwraps the node elements into suitable types.
|
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
|
String |
executeJavascript(String using,
Integer windowId)
Executes an arbitrary block of JavaScript on a given window, and returns the result of the
evaluation.
|
Object |
executeScript(String using,
boolean responseExpected)
Executes a script and returns the response (based on responseExpected)
|
Integer |
executeScriptOnObject(String using,
int objectId) |
Integer |
getObject(String using)
Gets the object id using a script
|
int |
getRuntimeId()
Get the current runtime ID.
|
boolean |
isScriptInjectable()
Queries the current runtime to see if it's script injectable.
|
List<String> |
listFramePaths()
Lists the frame paths of available runtimes
|
void |
readyStateChanged(EcmascriptProtos.ReadyStateChange change)
Triggered on the ecmascript service when the state of a runtime changes
|
void |
releaseObject(int objectId)
Releases a specific object
|
void |
releaseObjects()
Makes objects available to gc, this doesn't free the objects immediately
|
void |
removeRuntime(int runtimeId)
Removes a runtime from the list, doesnt get called often due to runtime-stopped being sent late
(runtimes get suspended)
|
void |
resetFramePath()
Resets the frame path context to the top level frame and reinitializes the debugger runtime.
|
void |
resetRuntimesList()
Resets the list of runtimes and fetches a fresh list from Opera, this can be used to recover in
cases where runtimes go out of sync
|
Object |
scriptExecutor(String script,
Object... params)
Executes the given javascript via eval call
|
void |
setDriver(OperaDriver driver)
Set the driver this service belongs to.
|
void |
setFormElementValue(int objectId,
String value)
Set value of a form element.
|
void |
setRuntime(EsdbgProtos.RuntimeInfo runtime)
Sets the runtime to be used in injection required for event handler (STP/1 only)
|
boolean |
updateRuntime()
Finds a valid runtime and updates the runtime reference (active runtime)
|
getServiceName, getServiceVersion, initvoid setDriver(OperaDriver driver)
int getRuntimeId()
void setRuntime(EsdbgProtos.RuntimeInfo runtime)
void removeRuntime(int runtimeId)
void addRuntime(EsdbgProtos.RuntimeInfo info)
Object scriptExecutor(String script, Object... params)
script - the script to be executed on hostparams - array of params, can be string, long or web element(s)String executeJavascript(String using)
using - script to executeString executeJavascript(String using, boolean responseExpected)
using - script to executeresponseExpected - if true parse the responseObject executeScript(String using, boolean responseExpected)
using - the script to be injectedresponseExpected - the flag to enable/disable parsing responsenull otherwiseInteger getObject(String using)
using - the script to find the objectString callFunctionOnObject(String using, int objectId)
using - script with reference to the object "locator"objectId - the object to be used for injectionObject callFunctionOnObject(String using, int objectId, boolean responseExpected)
void changeRuntime(int index)
void changeRuntime(String frameName)
void cleanUpRuntimes(int windowId)
void cleanUpRuntimes()
List<Integer> examineObjects(Integer id)
id - object ID previously returned from an eval call to the debuggervoid releaseObjects()
boolean updateRuntime()
void resetRuntimesList()
void readyStateChanged(EcmascriptProtos.ReadyStateChange change)
change - EcmascriptProtos.ReadyStateChange
object with runtime infovoid releaseObject(int objectId)
objectId - Id of the object to be releasedvoid resetFramePath()
String executeJavascript(String using, Integer windowId)
using - the code to evaluatewindowId - the runtime ID, previously retrieved from the WindowManagerObject examineScriptResult(Integer id)
OperaWebElement's, arrays into
Java List's, hashes into Map's, numbers into Integer's, and
the remaining properties into String's.id - the object to examine the hierarchy ofvoid setFormElementValue(int objectId,
String value)
objectId - the ID of the object to set valuevalue - the value to setboolean isScriptInjectable()
Copyright © 2013. All Rights Reserved.