webdriver clear()清空输入后,数据自己恢复了

忘记密码界面:
1、先验证码通过sendkey() 输入123456
2、再通过clear()操作清除输入框
执行到clear(),输入框的确清除了,但123456又被自动填入了

开发源码:
图片说明

代码:用了下面2种方式都存在数据清空后自动恢复的问题

public void code(String text) throws InterruptedException{
    code.clear();
    code.sendKeys(text);
}

public void code(String text) throws InterruptedException{
    code.click();
    code.sendKeys(Keys.chord(Keys.CONTROL, "a"));
    code.sendKeys(text);
}

https://www.cnblogs.com/yoyoketang/p/11516138.html