Package org.uiautomation.ios.wkrdp.model

Examples of org.uiautomation.ios.wkrdp.model.RemoteObject


    Response resp = new Response();
    resp.setSessionId(getSession().getSessionId());
    resp.setStatus(0);

    if (res instanceof RemoteObject) {
      RemoteObject ro = (RemoteObject) res;
      RemoteWebElement rwe = ro.getWebElement();
      JSONObject jo = new JSONObject().put("ELEMENT", rwe.getReference());
      resp.setValue(jo);
    } else if (res instanceof Integer) {
      resp.setValue(res);
    } else if (res instanceof Boolean) {
View Full Code Here


    Response resp = new Response();
    resp.setSessionId(getSession().getSessionId());
    resp.setStatus(0);

    if (res instanceof RemoteObject) {
      RemoteObject ro = (RemoteObject) res;
      RemoteWebElement rwe = ro.getWebElement();
      JSONObject jo = new JSONObject().put("ELEMENT", rwe.getReference());
      resp.setValue(jo);
    } else if (res instanceof Integer) {
      resp.setValue(res);
    } else if (res instanceof Boolean) {
View Full Code Here

      if (body.has("value") && body.isNull("value")) {
        return (T) null;
      }

      if ("array".equals(body.optString("subtype"))) {
        RemoteObject array = new RemoteObject(body.getString("objectId"), this);
        RemoteObjectArray a = new RemoteObjectArray(array);
        ArrayList<Object> res = new ArrayList<Object>();
        for (Object ro : a) {
          res.add(ro);
        }
        return (T) res;
      }

      if (body.has("objectId")) {
        if ("node".equals(body.optString("subtype")) || "Window"
            .equals(body.optString("className"))) {
          return (T) new RemoteObject(body.getString("objectId"), this);
        } else {
          RemoteObject ro = new RemoteObject(body.getString("objectId"), this);
          JSONObject o = new JSONObject(ro.stringify());
          return (T) o;
        }

      }
      return (T) new RemoteObject(body.getString("objectId"), this);

    }
    throw new RuntimeException("NI " + body);
  }
View Full Code Here

TOP

Related Classes of org.uiautomation.ios.wkrdp.model.RemoteObject

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.