Examples of CrawlElement


Examples of com.crawljax.core.configuration.CrawlElement

        // Click Rules
        if (config.isClickDefault())
          builder.crawlRules().clickDefaultElements();
        else if (config.getClickRules().size() > 0) {
          for (ClickRule r : config.getClickRules()) {
            CrawlElement element;
            if (r.getRule() == RuleType.click)
              element = builder.crawlRules().click(r.getElementTag());
            else
              element = builder.crawlRules().dontClick(r.getElementTag());

            if (r.getConditions().size() > 0) {
              for (com.crawljax.web.model.Condition c : r.getConditions()) {
                if (c.getCondition().toString().startsWith("w")) {
                  switch (c.getCondition()) {
                    case wAttribute:
                      String[] s =
                              c.getExpression().replace(" ", "").split("=");
                      element.withAttribute(s[0], s[1]);
                      break;
                    case wText:
                      element.withText(c.getExpression());
                      break;
                    case wXPath:
                      element.underXPath(c.getExpression());
                      break;
                    default:
                      break;
                  }
                } else
                  element.when(getConditionFromConfig(c));
              }
            }
          }
        }
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.