1. 程式人生 > >WebDriver高級應用實例(2)

WebDriver高級應用實例(2)

NPU webdriver tps index test str 通過 ebe del

  2.1在日期選擇器上進行日期選擇

  被測網頁的網址:

  https://www.html5tricks.com/demo/Kalendae/index.html

  Java語言版本的API實例代碼 

  @Test
  public void testdataPicker()throws Exception {
    WebElement dataInputBox = driver.findElement(By.id("input1"));
    dataInputBox.clear();

    //通過文本框中輸入日期來對日期選擇器進行選擇
    dataInputBox.sendKeys("3/20/2019");

  }

WebDriver高級應用實例(2)