如题:
使用 xpath 成功定位到 EditText 之后,想输入"72419596",但实际输入的确是"772419596".
请各位帮忙看一下.
1.是什么导致了这个问题?
2.如何解决?

脚本代码如下:

edittext = driver.find_element_by_xpath('//EditText[@text="用户名"]')
edittext.send_keys("72419596")

Appium 执行 Log 如下:

info: Responding to client with success: {"status":0,"value":{"ELEMENT":"2"},"sessionId":"52d757a0-1cf3-4c1c-bbad-9d780b54311e"}
POST /wd/hub/session/52d757a0-1cf3-4c1c-bbad-9d780b54311e/element 200 521ms - 109b
debug: Appium request initiated at /wd/hub/session/52d757a0-1cf3-4c1c-bbad-9d780b54311e/element/2/value
debug: Request received with params: {"sessionId":"52d757a0-1cf3-4c1c-bbad-9d780b54311e","id":"2","value":["7","2","4","1","9","5","9","6"]}
info: Pushing command to appium work queue: ["element:setText",{"elementId":"2","text":"72419596"}]
info: [BOOTSTRAP] [info] Got data from client: {"cmd":"action","action":"element:setText","params":{"elementId":"2","text":"72419596"}}
info: [BOOTSTRAP] [info] Got command of type ACTION
info: [BOOTSTRAP] [debug] Got command action: setText
info: [BOOTSTRAP] [info] Returning result: {"value":true,"status":0}
info: Responding to client with success: {"status":0,"value":true,"sessionId":"52d757a0-1cf3-4c1c-bbad-9d780b54311e"}


↙↙↙阅读原文可查看相关链接,并与作者交流