Package org.openqa.selenium.remote

Examples of org.openqa.selenium.remote.Response


  }

  @Override
  public Response handle() throws Exception {

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


  }


  @Override
  public synchronized Response handle() throws Exception {
    Response r = getSession().getCachedCapabilityResponse();
    if (r == null) {
      log.warning("Didn't know the capabilities. Should have known at registration.");
      throw new InstrumentsFailedToStartException(
          "The driver never recieved the capabilities or the "
          + "device. Most likely instruments crashed.");
View Full Code Here

    } else {
      backWeb();
    }
    getWebDriver().getContext().newContext();
    getWebDriver().waitForPageToLoad();
    Response resp = new Response();
    resp.setSessionId(getSession().getSessionId());
    resp.setStatus(0);
    resp.setValue(new JSONObject());
    return resp;
  }
View Full Code Here

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

    WorkingMode mode = getIOSDualDriver().getWorkingMode();
    String value = mode.toString();
    if (mode == WorkingMode.Web) {
      value = WorkingMode.Web + "_" + getWebDriver().getWindowHandle();
    }
    Response resp = new Response();
    resp.setSessionId(getSession().getSessionId());
    resp.setStatus(0);
    resp.setValue(value);
    return resp;
  }
View Full Code Here

    String propertyName = getRequest().getVariableValue(":name");
    String ref = getRequest().getVariableValue(":reference");
    RemoteWebElement element = getWebDriver().createElement(ref);
    Object value = element.getCssValue(propertyName);
    Response res = new Response();
    res.setSessionId(getSession().getSessionId());
    res.setStatus(0);
    res.setValue(value);
    return res;
  }
View Full Code Here

      CommandConfiguration conf = getSession().configure(WebDriverLikeCommand.URL);
      conf.set("page load", timeout);
    } else {
      throw new UnsupportedCommandException("timeout " + payload + " NI");
    }
    Response res = new Response();
    res.setSessionId(getSession().getSessionId());
    res.setStatus(0);
    res.setValue(new JSONObject());
    return res;
  }
View Full Code Here

  @Override
  public Response handle() throws Exception {
    waitForPageToLoad();
    String title = getWebDriver().getTitle();
    Response res = new Response();
    res.setSessionId(getSession().getSessionId());
    res.setStatus(0);
    res.setValue(title);
    return res;
  }
View Full Code Here

            }
        }

        public Response execute(Command command) throws IOException {
            long when = System.currentTimeMillis();
            Response execution = null;
            try {
                execution = realExecutor.execute(command);
            } finally {
                long dur = System.currentTimeMillis() - when;
                synchronized (journal) {
View Full Code Here

  public void render(HttpServletRequest request, HttpServletResponse response, Handler handler)
      throws Exception {
    Exception e = (Exception) request.getAttribute(exceptionName);

    Response res = new Response();
    res.setError(true);

    String raw = new BeanToJsonConverter().convert(e);
    JSONObject error = new JSONObject(raw);
    if (raw.startsWith("{")) {
      error.put("screen", request.getAttribute("screen"));
    }
    res.setValue(error.toString());

    request.setAttribute(propertyName, res);

    super.render(request, response, handler);
  }
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.