Code example for JSONObject

Methods: optString

0
 
  public SetOrientationNHandler(IOSServerManager driver, WebDriverLikeRequest request) {
    super(driver, request);
 
    JSONObject payload = request.getPayload();
    String orientation = payload.optString("orientation");
    Orientation o = Orientation.valueOf(orientation);
 
    String js = template.replace(":sessionId", request.getSession()).replace(":orientation",
                                                                             o.instrumentsValue());
 
    setJS(js);
  } 
 
  @Override 
  public Response handle() throws Exception { 
    Response r = super.handle();
    return r;
  } 
 
  @Override