Package com.crawljax.condition.eventablecondition

Examples of com.crawljax.condition.eventablecondition.EventableCondition


    return false;
  }

  private void evaluateElement(Builder<CandidateElement> results, String relatedFrame,
          CrawlElement crawl, Element sourceElement) {
    EventableCondition eventableCondition =
            checkedElements.getEventableConditionChecker().getEventableCondition(
                    crawl.getId());
    String xpath = XPathHelper.getXPathExpression(sourceElement);
    // get multiple candidate elements when there are input
    // fields connected to this element

    List<CandidateElement> candidateElements = new ArrayList<CandidateElement>();
    if (eventableCondition != null && eventableCondition.getLinkedInputFields() != null
            && eventableCondition.getLinkedInputFields().size() > 0) {
      // add multiple candidate elements, for every input
      // value combination
      candidateElements =
              formHandler.getCandidateElementsForInputs(sourceElement, eventableCondition);
    } else {
View Full Code Here


    }

    for (CrawlElement crawlElem : excludeCrawlElements
            .get(element.getTagName().toUpperCase())) {
      boolean matchesXPath = false;
      EventableCondition eventableCondition =
              eventableConditionChecker.getEventableCondition(crawlElem.getId());
      try {
        String asXpath = XPathHelper.getXPathExpression(element);
        matchesXPath =
                eventableConditionChecker.checkXpathStartsWithXpathEventableCondition(
View Full Code Here

   * @return The eventableConditions.
   */
  protected List<EventableCondition> getEventableConditions() {
    List<EventableCondition> eventableConditions = new ArrayList<EventableCondition>();
    for (CrawlElement crawlTag : getAllCrawlElements()) {
      EventableCondition eventableCondition = crawlTag.getEventableCondition();
      if (eventableCondition != null) {
        eventableConditions.add(eventableCondition);
      }
    }

View Full Code Here

  protected EventableCondition getEventableCondition() {
    if ((getWithXpathExpression() == null || getWithXpathExpression().equals(""))
            && getConditions().size() == 0 && getInputFieldIds().size() == 0) {
      return null;
    }
    EventableCondition eventableCondition = new EventableCondition(getId());
    if (getWithXpathExpression() != null && !getWithXpathExpression().equals("")) {
      eventableCondition.setInXPath(getWithXpathExpression());
    }
    if (getConditions().size() > 0) {
      eventableCondition.setConditions(getConditions());
    }
    if (getInputFieldIds().size() > 0) {
      eventableCondition.setLinkedInputFields(getInputFieldIds());
    }
    return eventableCondition;
  }
View Full Code Here

      getFramesCandidates(dom, crawlTagElements, crawlExcludeTagElements, clickOnce,
              results, relatedFrame);

      for (Element sourceElement : foundElements) {
        EventableCondition eventableCondition =
                checkedElements.getEventableConditionChecker().getEventableCondition(
                        tag.getId());
        String xpath = XPathHelper.getXPathExpression(sourceElement);
        // get multiple candidate elements when there are input
        // fields connected to this element

        List<CandidateElement> candidateElements = new ArrayList<CandidateElement>();
        if (eventableCondition != null
                && eventableCondition.getLinkedInputFields() != null
                && eventableCondition.getLinkedInputFields().size() > 0) {
          // add multiple candidate elements, for every input
          // value combination
          candidateElements = formHandler.getCandidateElementsForInputs(
                  sourceElement, eventableCondition);
        } else {
View Full Code Here

    if (tagElement.getName() == null) {
      return result;
    }

    EventableCondition eventableCondition =
            eventableConditionChecker.getEventableCondition(tagElement.getId());
    // TODO Stefan; this part of the code should be re-factored, Hack-ed it this way to prevent
    // performance problems.
    boolean matchesXpath = true;
    List<String> expressions = null;
    if (eventableCondition != null && eventableCondition.getInXPath() != null) {

      expressions =
              XPathHelper.getXpathForXPathExpressions(dom, eventableCondition.getInXPath());
    }

    NodeList nodeList = dom.getElementsByTagName(tagElement.getName());
    Set<TagAttribute> attributes = tagElement.getAttributes();

    for (int k = 0; k < nodeList.getLength(); k++) {

      Element element = (Element) nodeList.item(k);
      if (eventableCondition != null && eventableCondition.getInXPath() != null) {
        try {
          matchesXpath = eventableConditionChecker.checkXPathUnderXPaths(
                  XPathHelper.getXPathExpression(element), expressions);
        } catch (Exception e) {
          matchesXpath = false;
View Full Code Here

    for (TagElement tag : excluded) {

      if (element.getTagName().equalsIgnoreCase(tag.getName())) {
        boolean matchesXPath = false;
        EventableCondition eventableCondition =
                eventableConditionChecker.getEventableCondition(tag.getId());
        try {
          matchesXPath =
                  eventableConditionChecker.checkXpathStartsWithXpathEventableCondition(
                          dom, eventableCondition,
View Full Code Here

      getFramesCandidates(dom, crawlTagElements, crawlExcludeTagElements, clickOnce,
              results, relatedFrame);

      for (Element sourceElement : foundElements) {
        EventableCondition eventableCondition =
                checkedElements.getEventableConditionChecker().getEventableCondition(
                        tag.getId());
        String xpath = XPathHelper.getXPathExpression(sourceElement);
        // get multiple candidate elements when there are input
        // fields connected to this element

        List<CandidateElement> candidateElements = new ArrayList<CandidateElement>();
        if (eventableCondition != null
                && eventableCondition.getLinkedInputFields() != null
                && eventableCondition.getLinkedInputFields().size() > 0) {
          // add multiple candidate elements, for every input
          // value combination
          candidateElements = formHandler.getCandidateElementsForInputs(
                  sourceElement, eventableCondition);
        } else {
View Full Code Here

    if (tagElement.getName() == null) {
      return result;
    }

    EventableCondition eventableCondition =
            eventableConditionChecker.getEventableCondition(tagElement.getId());
    // TODO Stefan; this part of the code should be re-factored, Hack-ed it this way to prevent
    // performance problems.
    boolean matchesXpath = true;
    List<String> expressions = null;
    if (eventableCondition != null && eventableCondition.getInXPath() != null) {

      expressions =
              XPathHelper.getXpathForXPathExpressions(dom, eventableCondition.getInXPath());
    }

    NodeList nodeList = dom.getElementsByTagName(tagElement.getName());
    Set<TagAttribute> attributes = tagElement.getAttributes();

    for (int k = 0; k < nodeList.getLength(); k++) {

      Element element = (Element) nodeList.item(k);
      if (eventableCondition != null && eventableCondition.getInXPath() != null) {
        try {
          matchesXpath = eventableConditionChecker.checkXPathUnderXPaths(
                  XPathHelper.getXPathExpression(element), expressions);
        } catch (Exception e) {
          matchesXpath = false;
View Full Code Here

    for (TagElement tag : excluded) {

      if (element.getTagName().equalsIgnoreCase(tag.getName())) {
        boolean matchesXPath = false;
        EventableCondition eventableCondition =
                eventableConditionChecker.getEventableCondition(tag.getId());
        try {
          matchesXPath =
                  eventableConditionChecker.checkXpathStartsWithXpathEventableCondition(
                          dom, eventableCondition,
View Full Code Here

TOP

Related Classes of com.crawljax.condition.eventablecondition.EventableCondition

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.