Object arg = args.get(i);
if (arg instanceof JSONObject) {
JSONObject jsonArg = (JSONObject) arg;
if (jsonArg.optString("ELEMENT") != null) {
// TODO use driver factory to check the pageId
NodeId n = new NodeId(Integer.parseInt(jsonArg.optString("ELEMENT").split("_")[1]));
RemoteWebElement rwep = new RemoteWebElement(n, this);
arguments.put(new JSONObject().put("objectId", rwep.getRemoteObject().getId()));
}
} else if (arg instanceof JSONArray) {
JSONArray jsonArr = (JSONArray) arg;