Package org.uiautomation.ios.communication

Examples of org.uiautomation.ios.communication.WebDriverLikeRequest


  protected List<WebElement> findElements(String by, String using) {
    if (using == null) {
      throw new IllegalArgumentException("Cannot find elements when the selector is null.");
    }

    WebDriverLikeRequest request = executor.buildRequest(WebDriverLikeCommand.ELEMENTS_ROOT, ImmutableMap.of("using", by, "value", using));
    return executor.execute(request);
  }
View Full Code Here


    return findElements(executor, c);
  }

  @Override
  public Set<String> getWindowHandles() {
    WebDriverLikeRequest request = executor.buildRequest(WebDriverLikeCommand.WINDOW_HANDLES);
    List<String> all = executor.execute(request);
    Set<String> res = new HashSet<String>();
    res.addAll(all);
    return res;
  }
View Full Code Here

    // Escape the quote marks
    script = script.replaceAll("\"", "\\\"");

    Iterable<Object> convertedArgs = Iterables.transform(Lists.newArrayList(args), new WebElementToJsonConverter());
    Map<String, ?> params = ImmutableMap.of("script", script, "args", Lists.newArrayList(convertedArgs));
    WebDriverLikeRequest request = executor.buildRequest(WebDriverLikeCommand.EXECUTE_SCRIPT, params);

    return executor.execute(request);
  }
View Full Code Here

    // Escape the quote marks
    script = script.replaceAll("\"", "\\\"");

    Iterable<Object> convertedArgs = Iterables.transform(Lists.newArrayList(args), new WebElementToJsonConverter());
    Map<String, ?> params = ImmutableMap.of("script", script, "args", Lists.newArrayList(convertedArgs));
    WebDriverLikeRequest request = executor.buildRequest(WebDriverLikeCommand.EXECUTE_ASYNC_SCRIPT, params);

    return executor.execute(request);
  }
View Full Code Here

    return new LazyKeyboard(this);
  }

  @Override
  public void rotate(ScreenOrientation orientation) {
    WebDriverLikeRequest request = executor.buildRequest(WebDriverLikeCommand.SET_ORIENTATION, ImmutableMap.of("orientation", orientation));
    executor.execute(request);
  }
View Full Code Here

    WebDriverLikeRequest request = executor.buildRequest(WebDriverLikeCommand.SET_ORIENTATION, ImmutableMap.of("orientation", orientation));
    executor.execute(request);
  }

  public void rotate(Orientation orientation) {
    WebDriverLikeRequest request = executor.buildRequest(WebDriverLikeCommand.SET_ORIENTATION, ImmutableMap.of("orientation", orientation));
    executor.execute(request);
  }
View Full Code Here

    executor.execute(request);
  }

  @Override
  public ScreenOrientation getOrientation() {
    WebDriverLikeRequest request = executor.buildRequest(WebDriverLikeCommand.GET_ORIENTATION);
    String res = executor.execute(request);
    return ScreenOrientation.valueOf(res);
  }
View Full Code Here

    String res = executor.execute(request);
    return ScreenOrientation.valueOf(res);
  }

  public Orientation getNativeOrientation() {
    WebDriverLikeRequest request = executor.buildRequest(WebDriverLikeCommand.GET_ORIENTATION);
    String res = executor.execute(request);
    return Orientation.valueOf(res);
  }
View Full Code Here

    String res = executor.execute(request);
    return Orientation.valueOf(res);
  }

  public Dimension getScreenSize() {
    WebDriverLikeRequest request = executor.buildRequest(WebDriverLikeCommand.GET_SCREENRECT);
    Map<String, Object> size = executor.execute(request);

    Long height = (Long) size.get("height");
    Long width = (Long) size.get("width");
View Full Code Here

  }


  public static JSONObject logElementTree(WebDriverLikeCommandExecutor executor, File screenshot, boolean translation) {
    Map params = ImmutableMap.of("attachScreenshot", screenshot != null, "translation", translation);
    WebDriverLikeRequest request = executor.buildRequest(WebDriverLikeCommand.TREE_ROOT, params);
    JSONObject log = executor.execute(request);
    if (screenshot != null) {
      JSONObject screen = log.optJSONObject("screenshot");
      String content = screen.optString("64encoded");
      RemoteUIAElement.createFileFrom64EncodedString(screenshot, content);
View Full Code Here

TOP

Related Classes of org.uiautomation.ios.communication.WebDriverLikeRequest

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.