Package org.openqa.selenium

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


      return resultEl.findElement(By.id("updateBtn"));
    }

    public void setFile() {
      WebElement fileCotrol = getFileControl();
      fileCotrol.sendKeys(file.getAbsolutePath());
    }

    public void clickUpdate() {
      getUpdateBtn().click();
    }
View Full Code Here


    driver.get(appUrl+"/#/login");

    WebDriverWait wait = new WebDriverWait(driver, 10);

    WebElement user = wait.until(ExpectedConditions.presenceOfElementLocated(By.cssSelector("input[type=\"text\"]")));
    user.sendKeys("demo");

    WebElement password= wait.until(ExpectedConditions.presenceOfElementLocated(By.cssSelector("input[type=\"password\"]")));
    password.sendKeys("demo");

    WebElement submit = wait.until(ExpectedConditions.presenceOfElementLocated(By.cssSelector("button[type=\"submit\"]")));
View Full Code Here

    WebElement user = wait.until(ExpectedConditions.presenceOfElementLocated(By.cssSelector("input[type=\"text\"]")));
    user.sendKeys("demo");

    WebElement password= wait.until(ExpectedConditions.presenceOfElementLocated(By.cssSelector("input[type=\"password\"]")));
    password.sendKeys("demo");

    WebElement submit = wait.until(ExpectedConditions.presenceOfElementLocated(By.cssSelector("button[type=\"submit\"]")));
    submit.submit();

    WebElement element = wait.until(ExpectedConditions.presenceOfElementLocated(By.cssSelector("a.tile")));
View Full Code Here

    driver.get(appUrl + "/#/login");

    WebDriverWait wait = new WebDriverWait(driver, 10);

    WebElement user = wait.until(ExpectedConditions.presenceOfElementLocated(By.cssSelector("input[type=\"text\"]")));
    user.sendKeys("demo");

    WebElement password= wait.until(ExpectedConditions.presenceOfElementLocated(By.cssSelector("input[type=\"password\"]")));
    password.sendKeys("demo");

    WebElement submit = wait.until(ExpectedConditions.presenceOfElementLocated(By.cssSelector("button[type=\"submit\"]")));
View Full Code Here

    WebElement user = wait.until(ExpectedConditions.presenceOfElementLocated(By.cssSelector("input[type=\"text\"]")));
    user.sendKeys("demo");

    WebElement password= wait.until(ExpectedConditions.presenceOfElementLocated(By.cssSelector("input[type=\"password\"]")));
    password.sendKeys("demo");

    WebElement submit = wait.until(ExpectedConditions.presenceOfElementLocated(By.cssSelector("button[type=\"submit\"]")));
    submit.submit();

//    String xpathExpression = "//td[contains(text(),'Assign Approver')]";
View Full Code Here

   * 在Element中输入文本内容.
   */
  public void type(By by, String text) {
    WebElement element = driver.findElement(by);
    element.clear();
    element.sendKeys(text);
  }

  /**
   * 点击Element.
   */
 
View Full Code Here

        }
       
        public void setName(String name) {
            WebElement nameInput = getNameInput();
            nameInput.clear();
            nameInput.sendKeys(name);
        }

        public void setTags(String tags) {
            WebElement tagsInput = getTagsInput();
            tagsInput.clear();
View Full Code Here

        }

        public void setTags(String tags) {
            WebElement tagsInput = getTagsInput();
            tagsInput.clear();
            tagsInput.sendKeys(tags);
        }

        public void setDescription(String description) {
            WebElement descriptionInput = getDescriptionInput();
            descriptionInput.clear();
View Full Code Here

        }

        public void setDescription(String description) {
            WebElement descriptionInput = getDescriptionInput();
            descriptionInput.clear();
            descriptionInput.sendKeys(description);
        }
       
        public void setAutoFollow(boolean autoFollow) {
          WebElement autoFollowCheckbox = getAutoFollowCheckbox();
          if (autoFollow && !autoFollowCheckbox.isSelected()) {
View Full Code Here

            return resultEl.findElements(By.tagName("button")).get(1);
        }
       
        public void setFile(String file) {
            WebElement fileInput = getFileInput();
            fileInput.sendKeys(file);
        }

        public void setTags(String tags) {
            WebElement tagsInput = getTagsInput();
            tagsInput.clear();
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.