Package org.openqa.selenium

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


    WebElement element = driver.findElement(By.id("withText"));
    element.sendKeys("Some text");
    String value = element.getAttribute("value");
    assertTrue(value.length() > 0);

    element.clear();
    value = element.getAttribute("value");

    assertEquals(value.length(), (0));
  }
View Full Code Here


  @Test(timeOut = 600 * 1000,enabled=false) // takes 220secs on a mac pro
  public void testShouldBeAbleToSendKeysFromAuxiliaryKeyboard() {
    driver.get(pages.formPage);
    WebElement input = driver.findElement(By.id("working"));
    input.clear();
    input.sendKeys(AUXILIARY_KEYS);
    assertEquals(AUXILIARY_KEYS, input.getAttribute("value"));
  }

  @Test
View Full Code Here

    c.setConfiguration(WebDriverLikeCommand.SET_VALUE, "nativeEvents", false);
    driver.get(pages.formPage);
    WebElement input = driver.findElement(By.id("working"));
    input.sendKeys("1-800-FLOWERS");
    assertEquals("1-800-FLOWERS", input.getAttribute("value"));
    input.clear();
    input.sendKeys(AUXILIARY_KEYS);
    assertEquals(AUXILIARY_KEYS, input.getAttribute("value"));
  }

  @Test
View Full Code Here

        }

        public EditView setAuthorGroups(Set<String> groups)
        {
            final WebElement textarea = driver.findElement(By.id("sp-author-groups-edit"));
            textarea.clear();
            textarea.sendKeys(StringUtils.join(groups, "\n"));
            return this;
        }
       
        public EditView setAccessGroups(Set<String> groups)
View Full Code Here

        }
       
        public EditView setAccessGroups(Set<String> groups)
        {
            final WebElement textarea = driver.findElement(By.id("sp-access-groups-edit"));
            textarea.clear();
            textarea.sendKeys(StringUtils.join(groups, "\n"));
            return this;
        }

        private void toggle(By locator, boolean val)
View Full Code Here

        assertEquals(
                "original value not found, wrong cell or contents (1st column of the 2nd row expected)",
                "Teppo", textField.getAttribute("value"));

        // update value
        textField.clear();
        textField.sendKeys("baa");

        // click on another row
        table.getCell(0, 1).click();
View Full Code Here

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

  public boolean isElementPresent(By by) {
    return getDriver().findElements(by).size() != 0;
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

  /**
   * 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);
  }

  public static String getStudentsString(List<Student> list) {

View Full Code Here

    driver.get(baseUrl + "/?restartApplication");
    driver.findElement(By.xpath("//div[text()='Embedded Form']")).click();
    driver.findElement(By.cssSelector("div.v-table-cell-wrapper")).click();
    WebElement addressinput = driver.findElements(
        By.className("v-textfield")).get(2);
    addressinput.clear();
    addressinput.sendKeys("Ruukinkatu 2222");

    driver.findElement(By.xpath("//span[text()='Apply']")).click();
    driver.findElement(By.xpath("//tr[2]/td/div")).click();
    driver.findElement(By.cssSelector("div.v-table-cell-wrapper")).click();
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.