Code example for JSONArray

Methods: put

0
 
  public String getTextAreaValue() throws Exception {
    JSONObject cmd = new JSONObject();
    cmd.put("method", "Runtime.callFunctionOn");
 
    JSONArray args = new JSONArray();
    args.put(new JSONObject().put("value", ""));
 
    cmd.put(
        "params", 
        new JSONObject().put("objectId", this.getId())
            .put("functionDeclaration", "(function(arg) { var res = this.value; return res;})")
            .put("arguments", args)
            .put("returnByValue", true));
 
    JSONObject response = inspector.sendCommand(cmd);
    return inspector.cast(response);
  } 
}