Appium : Clear a field

后端 未结 26 3105
野趣味
野趣味 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:59

    If the text field contains any pre-specified mobile number, please do in the following way.

    WebElement mob = driver.findElement(By.name("xxxxxxxxxx")); mob.clear();

    xxxxxxxxxx: mobile number that is pre-specified while opening the application.

    Else use some other locating techniques like By.xpath , By.id(if you are testing android and Selendroid as capability) etc.

提交回复
热议问题