Appium : Clear a field

后端 未结 26 3186
野趣味
野趣味 2020-12-16 16:03

I have my login screen in app now. Each time the app is launched in screen the mobile number is pre filled with the older text.

I just want to know I have tried:

26条回答
  •  情书的邮戳
    2020-12-16 16:47

    A click on to the textBox before you clear should do with the latest libs:

    WebElement mob = driver.findElement(By.name("Mobile Number"));
    mob.click();
    mob.clear();
    

    OR from the sample jUnitTest here

    WebElement text = driver.findElement(By.xpath("//UIATextField[1]"));
    text.sendKeys("12");
    text.clear();
    

    I guess

提交回复
热议问题