Package org.uiautomation.ios.UIAModels.predicate

Examples of org.uiautomation.ios.UIAModels.predicate.TypeCriteria.stringify()



  @Test
  public void uiclass() throws Exception {
    TypeCriteria name = new TypeCriteria(UIAElement.class);
    JSONObject o = name.stringify();

    TypeCriteria c = AbstractCriteria.parse(o);

    Assert.assertEquals(name.getClass(), c.getClass());
    Assert.assertEquals(name.getValue(), c.getValue());
View Full Code Here


    String value = payload.getString("value");
    if ("tag name".equals(using) || "class name".equals(using)) {
      try {
        Package p = UIAElement.class.getPackage();
        Criteria c = new TypeCriteria(Class.forName(p.getName() + "." + value));
        return c.stringify();
      } catch (ClassNotFoundException e) {
        throw new InvalidSelectorException(value + " is not a recognized type.");
      }
      //  http://developer.apple.com/library/ios/#documentation/uikit/reference/UIAccessibilityIdentification_Protocol/Introduction/Introduction.html
    } else if ("name".equals(using) || "id".equals(using)) {
View Full Code Here

        throw new InvalidSelectorException(value + " is not a recognized type.");
      }
      //  http://developer.apple.com/library/ios/#documentation/uikit/reference/UIAccessibilityIdentification_Protocol/Introduction/Introduction.html
    } else if ("name".equals(using) || "id".equals(using)) {
      Criteria c = new NameCriteria(getAUT().applyL10N(value));
      return c.stringify();
    } else if ("link text".equals(using) || "partial link text".equals(using)) {
      return createGenericCriteria(using, value);
    } else {
      throw new InvalidSelectorException(
          using + "is not a valid selector for the native part of ios-driver.");
View Full Code Here

    if (dim.getWidth() != webPageWidth) {
      log.fine("BUG : dim.getWidth()!=webPageWidth");
    }

    Criteria c = new TypeCriteria(UIAWebView.class);
    String json = c.stringify().toString();
    StringBuilder script = new StringBuilder();
    script.append("var root = UIAutomation.cache.get('1');");
    script.append("var webview = root.element(-1," + json + ");");
    script.append("var webviewSize = webview.rect();");
    script.append("var ratioX = 1.0 * webviewSize.size.width / " + dim.getWidth() + ";");
View Full Code Here

          script.append("if (delta<20){delta=20;};");
          script.append("var y = top+delta;");
        }
      } else {
        Criteria wv = new TypeCriteria(UIAScrollView.class);
        script.append("var webview = root.element(-1," + wv.stringify().toString() + ");");
        script.append("var size = webview.rect();");
        script.append("var offsetY = size.origin.y;");
        // UIAWebView.y
        script.append("var y = top+offsetY;");
        //script.append("var y = top+64;");
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.