Examples of findFirstElementThatMatches()


Examples of daveayan.gherkinsalad.components.Elements.findFirstElementThatMatches()

  }

  public String get_selected_option() {
    if (isEnabled()) {
      Elements options = root_element().findElements(By.tagName("option"));
      Element selected_option = options.findFirstElementThatMatches(new Predicate<Element>() {
        public boolean apply(Element input) {
          String selected = input.getAttribute("selected");
          if(StringUtils.isNotBlank(selected)) {
            return selected.equals("selected");
          }
View Full Code Here

Examples of daveayan.gherkinsalad.components.Elements.findFirstElementThatMatches()

    if(isEnabled()) {
      click_if_enabled();
      Element ul = find_ul_element();
      Elements li_s = ul.findElements(By.tagName("a"));
     
      Element selected_element = li_s.findFirstElementThatMatches(new Predicate<Element>() {
        public boolean apply(Element li_a) {
          String value = li_a.getAttribute("aria-selected");
          if(StringUtils.isBlank(value)) {
            return false;
          }
View Full Code Here

Examples of daveayan.gherkinsalad.components.Elements.findFirstElementThatMatches()

    return tab.getAttribute("aria-selected").contains("true");
  }
 
  private Element find_tab_li(final String tab_name) {
    Elements tabs = root_element().findElements(By.tagName("li"));
    Element tab = tabs.findFirstElementThatMatches(new Predicate<Element>() {
      public boolean apply(Element arg0) {
        return arg0.is(tab_name);
      }
    });
    return tab;
View Full Code Here

Examples of daveayan.gherkinsalad.components.Elements.findFirstElementThatMatches()

    return tab.getCssValue("aria-selected").contains("true");
  }
 
  private Element find_tab_li(final String tab_name) {
    Elements tabs = root_element().findElements(By.tagName("li"));
    Element tab = tabs.findFirstElementThatMatches(new Predicate<Element>() {
      public boolean apply(Element arg0) {
        return arg0.is(tab_name);
      }
    });
    return tab;
View Full Code Here

Examples of daveayan.gherkinsalad.components.core.Elements.findFirstElementThatMatches()

    select_code_if_enabled(option);
  }

  public void select_code_if_enabled(final String code) {
    Elements root_elements = root_elements();
    Element element_to_select = root_elements.findFirstElementThatMatches(new Predicate<Element>() {
      public boolean apply(Element input) {
        String value = input.getAttribute("value");
        if(value == null) return Boolean.FALSE;
        return value.trim().equals(code);
      }
View Full Code Here

Examples of daveayan.gherkinsalad.components.core.Elements.findFirstElementThatMatches()

    Elements root_elements = root_elements();
    final Elements all_labels = findElements(By.tagName("label"));
    Element element_to_select = root_elements.findFirstElementThatMatches(new Predicate<Element>() {
      public boolean apply(Element input) {
        final String id = input.getAttribute("id");
        Element label_for_radio_button = all_labels.findFirstElementThatMatches(new Predicate<Element>() {
          public boolean apply(Element input) {
            String label_for = input.getAttribute("for");
            return StringUtils.equals(label_for, id);
          }
        });
View Full Code Here

Examples of daveayan.gherkinsalad.components.core.Elements.findFirstElementThatMatches()

    element_to_select.click();
  }

  public void select_code_if_enabled(final String code) {
    Elements root_elements = root_elements();
    Element element_to_select = root_elements.findFirstElementThatMatches(new Predicate<Element>() {
      public boolean apply(Element input) {
        String value = input.getAttribute("value");
        if(value == null) return Boolean.FALSE;
        return value.trim().equals(code);
      }
View Full Code Here

Examples of daveayan.gherkinsalad.components.core.Elements.findFirstElementThatMatches()

    final Element selected_element = getSelectedElement();
    if(selected_element.is_null()) {
      return StringUtils.EMPTY;
    }
    final Elements all_labels = findElements(By.tagName("label"));
    Element selected_element_label = all_labels.findFirstElementThatMatches(new Predicate<Element>() {
      public boolean apply(Element input) {
        String label_for = input.getAttribute("for");
        return StringUtils.equals(label_for, selected_element.getAttribute("id"));
      }
    });
View Full Code Here

Examples of daveayan.gherkinsalad.components.core.Elements.findFirstElementThatMatches()

      }});
  }
 
  private Element getSelectedElement() {
    Elements root_elements = root_elements();
    Element selected_element = root_elements.findFirstElementThatMatches(new Predicate<Element>() {
      public boolean apply(Element input) {
        String checked = input.getAttribute("checked");
        if(checked == null) {
          return Boolean.FALSE;
        }
View Full Code Here

Examples of daveayan.gherkinsalad.components.core.Elements.findFirstElementThatMatches()

    return option_strings;
  }

  public String get_selected_option_text() {
    Elements options = root_element().findElements(By.tagName("option"));
    Element selected_option = options.findFirstElementThatMatches(new Predicate<Element>() {
      public boolean apply(Element input) {
        String selected = input.getAttribute("selected");
        if(StringUtils.isNotBlank(selected)) {
          return selected.equals("selected") || selected.equals("true");
        }
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.