Appium 【已解决】【Appium-Android】有人遇到使用 send_keys 时,日志报 Clearing text not successful 的问题吗?

大东 · 2014年08月28日 · 最后由 xuxiujin 回复于 2014年10月11日 · 1758 次阅读

代码是这样子的:

userEditField = dr.find_element_by_id('com.hujiang.hjclass:id/etLoginUsername')
userEditField.send_keys("kuroko1")
sleep(2)

日志里执行到这里的时候:

info: [debug] [BOOTSTRAP] [debug] Clearing text not successful using selectAllDelete now trying to send delete keys.
info: [debug] [BOOTSTRAP] [debug] Finding methods on class: class com.android.uiautomator.core.UiAutomatorBridge
info: [debug] [BOOTSTRAP] [debug] Clearing text not successful falling back to UiAutomator method clear
info: [debug] [BOOTSTRAP] [debug] clearText not successful, continuing with setText anyway
info: [debug] [BOOTSTRAP] [debug] Sending plain text to element: 沪江用户名/邮箱/手机kuroko1
info: [debug] [BOOTSTRAP] [debug] Returning result: {"value":true,"status":0}

可以看到执行到 send_keys 的时候,就提示 Clearing text not successful 了,然后 sending 进去的 text 是:

Sending plain text to element: 沪江用户名/邮箱/手机kuroko1

实际上在手机上看到是无任何输入操作的。
没弄明白是什么问题引起的?

如果觉得我的文章对您有用,请随意打赏。您的支持将鼓励我继续创作!
共收到 9 条回复 时间 点赞


刚 Google 到的,希望对你有帮助

#1 楼 @xiaxin 谢谢~

确定问题了,以 Python 为例,1.2.2 开始使用 set_text;
且更新 appium 时别忘记更新客户端,客户端更新地址:https://github.com/AnikiKun/python-client

#3 楼 @anikikun 现在问题解决了吗

#4 楼 @xiang2743 解决了。3 楼说的很清楚。

楼主你好!我也遇到同样的问题,我的系统是 MAC,奇怪的是在手机上密码框的输入是正常的,但是用户名这一行一直都是没有任何操作的!
info: [debug] [BOOTSTRAP] [debug] Clearing text not successful falling back to UiAutomator method clear

info: [debug] [BOOTSTRAP] [debug] clearText not successful, continuing with setText anyway

info: [debug] [BOOTSTRAP] [debug] Sending plain text to element: 邮箱/手机号码 15989345905

info: [debug] [BOOTSTRAP] [debug] Returning result: {"value":true,"status":0}

#6 楼 @xuxiujin 对,就是这样子的。你是 Python 驱动么,用的是 set_text() 么,client 是最新的么?

我用的是 JAVA,appium 是 1.2.2 的,就用户这一框输不进去,密码是输入正常的。
我用 threadSleep(1000L);
login_et_username.sendKeys(userName);

threadSleep(1000L);
login_et_password.sendKeys(password);
threadSleep(1000L);
btn_login.click();

appium 是 1.2.2,我怀疑你的 client 不是最新的。https://github.com/appium/java-client

刚刚贴错链接了~~

需要 登录 后方可回复, 如果你还没有账号请点击这里 注册