Package org.openqa.selenium.remote

Examples of org.openqa.selenium.remote.Response


  @Override
  public Response handle() throws Exception {
    String reference = getRequest().getVariableValue(":reference");
    RemoteWebElement element = getWebDriver().createElement(reference);
    boolean isDisplayed = element.isDisplayed();
    Response res = new Response();
    res.setSessionId(getSession().getSessionId());
    res.setStatus(0);
    res.setValue(isDisplayed);
    return res;
  }
View Full Code Here


    String url = getWebDriver().getCurrentUrl();
    URL u = new URL(url);
    String domain = u.getHost();

    getWebDriver().deleteCookie(name, url);
    Response res = new Response();
    res.setSessionId(getSession().getSessionId());
    res.setStatus(0);
    res.setValue(new JSONObject());
    return res;
  }
View Full Code Here

    SetScriptTimeoutNHandler.TIMEOUT = ms;
    for (WebDriverLikeCommand command : impacted) {
      getSession().configure(command).set("script", ms);
    }

    Response res = new Response();
    res.setSessionId(getSession().getSessionId());
    res.setStatus(0);
    res.setValue(new JSONObject());
    return res;
  }
View Full Code Here

      String key = iter.next();
      Object value = payload.opt(key);
      getSession().configure(command).set(key, value);
    }

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

  }
View Full Code Here

      IOSRunningApplication app = s.getApplication();
      IOSCapabilities cap = app.getCapabilities();
      session.put("capabilities", cap.getRawCapabilities());
      res.put(session);
    }
    Response resp = new Response();
    resp.setSessionId("dummy one");
    resp.setStatus(0);
    resp.setValue(res.toString());
    return resp;
  }
View Full Code Here


    JSONObject res = gen.generate();

    List<ServerSideSession> sessions = getServer().getSessions();
    Response resp = new Response();

    resp.setStatus(0);
    resp.setValue(res);
    if (sessions.size() == 0) {
      resp.setSessionId(null);
    } else if (sessions.size() == 1) {
      resp.setSessionId(sessions.get(0).getSessionId());
    } else {
      throw new WebDriverException("NI multi sessions per server.");
    }
    return resp;
  }
View Full Code Here

    SetImplicitWaitTimeoutNHandler.TIMEOUT = ms;
    for (WebDriverLikeCommand command : impacted) {
      getSession().configure(command).set("implicit_wait", ms);
    }

    Response res = new Response();
    res.setSessionId(getSession().getSessionId());
    res.setStatus(0);
    res.setValue(new JSONObject());
    return res;
  }
View Full Code Here

  @Override
  public Response handleAndRunDecorators() throws Exception {
    for (PreHandleDecorator pre : preDecorators) {
      pre.decorate(request);
    }
    Response response = null;
    try {
      response = handle();
    } catch (WebKitSeemsCorruptedException e) {
      log.warning("WebKitSeemsCorruptedException.Attempting a restart.");
      driver.restartWebkit();
View Full Code Here

    JSONObject res = new JSONObject().put("No config for this command", "");
    return res;
  }

  protected Response createResponse(Object value) {
    Response r = new Response();
    r.setSessionId(getSession().getSessionId());
    r.setStatus(0);
    r.setValue(value);
    return r;
  }
View Full Code Here

      if (session == null) {
        throw new SessionNotCreatedException(
            "failed starting after " + MAX_RETRIES + " retries.Final wait was " + timeOut);
      }

      Response resp = new Response();
      resp.setSessionId(session.getSessionId());
      resp.setStatus(0);
      resp.setValue("");
      return resp;
    } catch (Exception e) {
      if (session != null) {
        session.stop();
      }
View Full Code Here

TOP

Related Classes of org.openqa.selenium.remote.Response

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.