Package org.openqa.selenium

Examples of org.openqa.selenium.WebElement.clear()


public class SetElementText implements StepType {
  @Override
  public boolean run(TestRun ctx) {
    WebElement el = ctx.locator("locator").find(ctx);
    el.click();
    el.clear();
    el.sendKeys(ctx.string("text"));
    return true;
  }
}
View Full Code Here


    WebElement element = dr.findElement(By.name("q"));
    element.sendKeys("something");
    Thread.sleep(1000);
   
//    clear
    element.clear();
   
    Thread.sleep(1000);
    System.out.println("browser will be close");
    dr.quit()
  }
View Full Code Here

     */
    private void testToolBarButton(String buttonTitle, String format, String defaultText)
    {
        editInWikiEditor(this.getClass().getSimpleName(), getName(), SYNTAX);
        WebElement textArea = getDriver().findElement(By.id("content"));
        textArea.clear();
        textArea.sendKeys("a");
        String buttonLocator = "//img[@title = '" + buttonTitle + "']";
        getSelenium().click(buttonLocator);
        // Type b and c on two different lines and move the caret after b.
        textArea.sendKeys("b", Keys.RETURN, "c", Keys.ARROW_LEFT, Keys.ARROW_LEFT);
View Full Code Here

    @Override
    public void executeUsing(JenkinsRule jenkins, WebDriver browser) throws Exception {
        WebElement element = browser.findElement(where);

        element.clear();
        element.sendKeys(what);
    }


    private final String what;
View Full Code Here

  /**
   * WebDriver fills the input field with text value (will clear the data first)
   */
  protected static void wdFillString(By by, String value) {
    WebElement ele = driver.findElement(by);
    ele.clear();
    ele.sendKeys(value);
  }

  protected static boolean isElementPresent(By by) {
    return driver.findElements(by).size() != 0;
View Full Code Here

    private void setTargetContent(final long rowIndex, final String text,
            final String idFormat, final Plurals plural) {
        WebElement we = waitForWebElement(By
                .id(String.format(idFormat, rowIndex, plural.index())));
        we.click();
        we.clear();
        we.sendKeys(text);
    }

    /**
     * Simulate a paste from the user's clipboard into the indicated row
View Full Code Here

  public void enter_text_if_enabled(String text) {
    wait_between_steps_plus(2);
//    browser.driver().switchTo().frame(0);
    browser.driver().switchTo().frame("content_ifr");
    WebElement editable = browser.driver().switchTo().activeElement();
    editable.clear();
    editable.sendKeys(text);
    browser.driver().switchTo().defaultContent();
  }

  public void append_text_if_enabled(String text) {
View Full Code Here

   */
  public void enter_text_if_enabled(String text) {
    wait_between_steps_plus(2);
    browser.driver().switchTo().frame(iframe_name_or_id);
    WebElement editable = browser.driver().switchTo().activeElement();
    editable.clear();
    editable.sendKeys(text);
    browser.driver().switchTo().defaultContent();
  }

  /**
 
View Full Code Here

  @Override
  public boolean input(Identification identification, String text) {
    try {
      WebElement field = browser.findElement(identification.getWebDriverBy());
      if (field != null) {
        field.clear();
        field.sendKeys(text);

        return true;
      }
      return false;
View Full Code Here

   * Inseri o login do usuário.
   * @param login Nome do login do usuário.
   */
  public void inserirLogin(String login){
    WebElement e = Webdriver.obterInstancia().findElement(By.id("login"));
    e.clear();
    e.sendKeys(login);
  }
 
  /**
   * Limpa o campo Login.
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.