Appium send_keys 时 Sending plain text to element 中的数据就会累加一次

mongnet · 2014年09月30日 · 最后由 longmfe 回复于 2015年02月17日 · 1876 次阅读
driver.find_element_by_name("设置").click()
driver.find_element_by_id('com.lubansoft.iban:id/serverUrl').send_keys('http://be3.lubansoft.com/LBBE300/')

很奇怪为什么我上面 send_keys 的代码每执行一次, Sending plain text to element 中的数据就会累加一次?
输入用户名的 send_keys 就不会重复

下面是 appium 日志

info: --> POST /wd/hub/session/1f2ae336-d50f-4d33-ab68-547bb45018f9/element/3/value {"sessionId":"1f2ae336-d50f-4d33-ab68-547bb45018f9","id":"3","value":["h","t","t","p",":","/","/","b","e","3",".","l","u","b","a","n","s","o","f","t",".","c","o","m","/","L","B","B","E","3","0","0","/"]}
info: [debug] Pushing command to appium work queue: ["element:setText",{"elementId":"3","text":"http://be3.lubansoft.com/LBBE300/","replace":false}]
info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"element:setText","params":{"elementId":"3","text":"http://be3.lubansoft.com/LBBE300/","replace":false}}
info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
info: [debug] [BOOTSTRAP] [debug] Got command action: setText
info: [debug] [BOOTSTRAP] [debug] Attempting to clear using UiObject.clearText().
info: [debug] [BOOTSTRAP] [debug] Sending plain text to element: http://be3.lubansoft.com/LBBE300/http://be3.lubansoft.com/LBBE300/http://be3.lubansoft.com/LBBE300/http://be3.lubansoft.com/LBBE300/http://be3.lubansoft.com/LBBE300/
共收到 3 条回复 时间 点赞

没有 cleartext 成功?

#1 楼 @xiaomayi0323
cleartext 成功了,但 Sending plain text to element 的值是累加的

我把 send_keys 改为 set_text 后没有出现这个问题了,情况不明

谢谢楼主,我的问题是每次用 send_keys 都什么没有输入, 换成 set_text 也好了

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