Package com.crawljax.core.state

Examples of com.crawljax.core.state.Element


    }
    return eventToFire;
  }

  private boolean visitAnchorHrefIfPossible(Eventable eventable) {
    Element element = eventable.getElement();
    String href = element.getAttributeOrNull("href");
    if (href == null) {
      LOG.info("Anchor {} has no href and is invisble so it will be ignored", element);
    } else {
      LOG.info("Found an invisible link with href={}", href);
      try {
View Full Code Here


   
    try {
      String xpathEventable = eventable.getIdentification().getValue();
      Node nodeSameXpath = Helper.getElementByXpath(dom, xpathEventable);
      if (nodeSameXpath != null) {
        Element elementSameXpath = new Element(nodeSameXpath);
        if (logging) {
          LOGGER.info("Try element with same xpath expression");
        }
        if (equivalent(elementSameXpath, logging)) {
          return xpathEventable;
        }
      }

      if (logging) {
        LOGGER.info("Search other candidate elements");
      }
      NodeList candidateElements =
              XPathHelper.evaluateXpathExpression(dom, "//"
                      + eventable.getElement().getTag().toUpperCase());
      if (logging) {
        LOGGER.info("Candidates: " + candidateElements.getLength());
      }
      for (int i = 0; i < candidateElements.getLength(); i++) {
        Element candidateElement = new Element(candidateElements.item(i));
        if (equivalent(candidateElement, logging)) {
          return XPathHelper.getXPathExpression(candidateElements.item(i));
        }
      }
View Full Code Here

   
    try {
      String xpathEventable = eventable.getIdentification().getValue();
      Node nodeSameXpath = Helper.getElementByXpath(dom, xpathEventable);
      if (nodeSameXpath != null) {
        Element elementSameXpath = new Element(nodeSameXpath);
        if (logging) {
          LOGGER.info("Try element with same xpath expression");
        }
        if (equivalent(elementSameXpath, logging)) {
          return xpathEventable;
        }
      }

      if (logging) {
        LOGGER.info("Search other candidate elements");
      }
      NodeList candidateElements =
              XPathHelper.evaluateXpathExpression(dom, "//"
                      + eventable.getElement().getTag().toUpperCase());
      if (logging) {
        LOGGER.info("Candidates: " + candidateElements.getLength());
      }
      for (int i = 0; i < candidateElements.getLength(); i++) {
        Element candidateElement = new Element(candidateElements.item(i));
        if (equivalent(candidateElement, logging)) {
          return XPathHelper.getXPathExpression(candidateElements.item(i));
        }
      }
View Full Code Here

TOP

Related Classes of com.crawljax.core.state.Element

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.