Package com.crawljax.core.state

Examples of com.crawljax.core.state.Identification


          candidateElements = formHandler.getCandidateElementsForInputs(
                  sourceElement, eventableCondition);
        } else {
          // just add default element
          candidateElements.add(new CandidateElement(sourceElement,
                  new Identification(Identification.How.xpath, xpath),
                  relatedFrame));
        }

        for (CandidateElement candidateElement : candidateElements) {
          if (!clickOnce || checkedElements.markChecked(candidateElement)) {
View Full Code Here


      String newXPath = new ElementResolver(eventable, getBrowser()).resolve();
      if (newXPath != null && !xpath.equals(newXPath)) {
        LOGGER.info("XPath changed from " + xpath + " to " + newXPath + " relatedFrame:"
                + eventable.getRelatedFrame());
        eventable =
                new Eventable(new Identification(Identification.How.xpath, newXPath),
                        eventType);
      }
    }

    if (getBrowser().fireEvent(eventable)) {
View Full Code Here

   *            the element
   * @param xpath
   *            the xpath expression of the element
   */
  public CandidateElement(Element element, String xpath) {
    this(element, new Identification(Identification.How.xpath, xpath), "");
  }
View Full Code Here

   *            the element
   * @param xpath
   *            the xpath expression of the element
   */
  public CandidateElement(Element element, String xpath) {
    this(element, new Identification(Identification.How.xpath, xpath), "");
  }
View Full Code Here

          candidateElements = formHandler.getCandidateElementsForInputs(
                  sourceElement, eventableCondition);
        } else {
          // just add default element
          candidateElements.add(new CandidateElement(sourceElement,
                  new Identification(Identification.How.xpath, xpath),
                  relatedFrame));
        }

        for (CandidateElement candidateElement : candidateElements) {
          if (!clickOnce || checkedElements.markChecked(candidateElement)) {
View Full Code Here

      String newXPath = new ElementResolver(eventable, getBrowser()).resolve();
      if (newXPath != null && !xpath.equals(newXPath)) {
        LOGGER.info("XPath changed from " + xpath + " to " + newXPath + " relatedFrame:"
                + eventable.getRelatedFrame());
        eventable = new Eventable(
                new Identification(Identification.How.xpath, newXPath), eventType);
      }
    }

    if (getBrowser().fireEvent(eventable)) {
View Full Code Here

   * @throws Exception
   */
  private Identification getIdentification(Node element) throws Exception {
    NamedNodeMap attributes = element.getAttributes();
    if (attributes.getNamedItem("id") != null) {
      return new Identification(Identification.How.id, attributes.getNamedItem("id")
              .getNodeValue());
    } else if (attributes.getNamedItem("name") != null) {
      return new Identification(Identification.How.name, attributes.getNamedItem("name")
              .getNodeValue());
    }

    // try to find the xpath
    String xpathExpr = XPathHelper.getXPathExpression(element);
    if (xpathExpr != null && !xpathExpr.equals("")) {
      return new Identification(Identification.How.xpath, xpathExpr);
    }

    return null;
  }
View Full Code Here

          int indexValue) {
    return getFormInput(browser, element, indexValue);
  }

  private FormInput getFormInput(EmbeddedBrowser browser, Node element, int indexValue) {
    Identification identification;
    try {
      identification = getIdentification(element);
      if (identification == null) {
        return null;
      }
    } catch (Exception e) {
      return null;
    }
    // CHECK
    String id = fieldMatches(identification.getValue());
    FormInput input = new FormInput();
    input.setType(getElementType(element));
    input.setIdentification(identification);
    Set<InputValue> values = new HashSet<InputValue>();
View Full Code Here

TOP

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

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.