Package daveayan.gherkinsalad.components.core

Examples of daveayan.gherkinsalad.components.core.Element


      action("Did not click '" + this + "' since it is not enabled");
    }
  }
 
  public void click_if_exists() {
    Element element = root_element();
    if(this.isDisplayed()) {
      element.click();
    } else {
      action("Did not click '" + this + "' since it is not displayed");
    }
  }
View Full Code Here


      action("Did not click '" + this + "' since it is not displayed");
    }
  }
 
  public void click_if_exists_and_enabled() {
    Element element = root_element();
    if(this.isEnabled() && this.isDisplayed()) {
      element.click();
    } else {
      action("Did not click '" + this + "' since it is not enabled and not displayed");
    }
  }
View Full Code Here

      action("Did not click '" + this + "' since it is not enabled and not displayed");
    }
  }

  public void enter_text_if_enabled(String text) {
    Element element = root_element();
    if(this.isEnabled()) {
      wait_between_steps();
      element.clear();
      element.sendKeys(text);
      action("Entered text '" + text + "' in " + this);
    } else {
      action("Did not enter text in element '" + this + "' since it is not enabled");
    }
  }
View Full Code Here

      action("Did not enter text in element '" + this + "' since it is not enabled");
    }
  }

  public void append_text_if_enabled(String text) {
    Element element = root_element();
    if(this.isEnabled()) {
      wait_between_steps();
      String current_text = element.getAttribute("value");
      element.clear();
      element.sendKeys(text + current_text);
      action("Appended text '" + text + "' in " + this);
    } else {
      action("Did not append text in element '" + this + "' since it is not enabled");
    }
  }
View Full Code Here

  public String getText() {
    if(isNotDisplayed()) {
      error("Element '" + this + "' is not displayed. Cannot getText on this element");
      return "NOT_DISPLAYED";
    }
    Element element = root_element();
    if(element.is_null()) {
      error("Element '" + this + "' is not displayed. Cannot getText on this element");
      return "IS_NULL";
    }
    return element.getAttribute("value");
  }
View Full Code Here

    return this;
  }

  public void click_if_enabled() {
    wait_between_steps();
    Element element = root_element();
    if(this.isEnabled()) {
      element.click();
    } else {
      action("Did not click disabled " + this);
      takeScreenshot();
    }
  }
View Full Code Here

    click_if_enabled();
  }
 
  public void click_if_exists_and_enabled() {
    wait_between_steps();
    Element element = root_element();
    if(! (element instanceof NullElement)) {
      if(this.isEnabled()) {
        element.click();
      } else {
        action("Did not click disabled " + this);
        takeScreenshot();
      }
    } else {
View Full Code Here

  public String getText() {
    if(isNotDisplayed()) {
      error("Element '" + this + "' is not displayed. Cannot getText on this element");
      return "NOT_DISPLAYED";
    }
    Element element = root_element();
    if(element.is_null()) {
      error("Element '" + this + "' is not displayed. Cannot getText on this element");
      return "IS_NULL";
    }
    return element.getAttribute("value");
  }
View Full Code Here

    }
    return element.getAttribute("value");
  }

  public void enter_text_if_enabled(String text) {
    Element element = root_element();
    if(this.isDisplayed() && this.isEnabled()) {
      wait_between_steps();
      element.clear();
      element.sendKeys(text);
      action("Entered text '" + text + "' in " + this);
    } else {
      action("Did not enter text '" + text + "' in disabled text field '" + this + "'");
    }
  }
View Full Code Here

      action("Did not enter text '" + text + "' in disabled text field '" + this + "'");
    }
  }

  public void append_text_if_enabled(String text) {
    Element element = root_element();
    if(this.isDisplayed() && this.isEnabled()) {
      wait_between_steps();
      String current_text = element.getAttribute("value");
      element.clear();
      element.sendKeys(text + current_text);
      action("Appended text '" + text + "' in " + this);
    } else {
      action("Did not append text '" + text + "' in disabled text field '" + this + "'");
    }
  }
View Full Code Here

TOP

Related Classes of daveayan.gherkinsalad.components.core.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.