在学习 appium 的过程中,使用 sendkeys 向文本框输入 18 位数字时,出现了随机随时数字的情况,查看了 appium 的日志如下:

2016-09-05 08:29:54:658 - info: <-- POST /wd/hub/session/e724ba56-d17f-4da9-9057-a01006aace17/element 200 616.728 ms - 88 {"status":0,"value":{"ELEMENT":"30"},"sessionId":"e724ba56-d17f-4da9-9057-a01006aace17"}
2016-09-05 08:29:54:663 - info: --> POST /wd/hub/session/e724ba56-d17f-4da9-9057-a01006aace17/element/30/value {"id":"30","value":["110105199408014099"]}
2016-09-05 08:29:54:664 - info: [debug] Pushing command to appium work queue: ["element:setText",{"elementId":"30","text":"110105199408014099","replace":false,"unicodeKeyboard":true}]
2016-09-05 08:29:54:668 - info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"element:setText","params":{"elementId":"30","text":"110105199408014099","replace":false,"unicodeKeyboard":true}}
2016-09-05 08:29:54:669 - info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
2016-09-05 08:29:54:670 - info: [debug] [BOOTSTRAP] [debug] Got command action: setText
2016-09-05 08:29:54:671 - info: [debug] [BOOTSTRAP] [debug] Using element passed in.
2016-09-05 08:29:54:688 - info: [debug] [BOOTSTRAP] [debug] Attempting to clear using UiObject.clearText().
2016-09-05 08:29:57:636 - info: [debug] [BOOTSTRAP] [debug] Sending plain text to element: 110105199408014099
2016-09-05 08:30:00:440 - info: [debug] [BOOTSTRAP] [debug] Returning result: {"value":true,"status":0}
2016-09-05 08:30:00:442 - info: [debug] Responding to client with success: {"status":0,"value":true,"sessionId":"e724ba56-d17f-4da9-9057-a01006aace17"}

在日志中,输入传递的值也是 18 位数字 “ 110105199408014099” 并没有错,但是在客户端中查看实际被输入的文本为 “110105 9408 099”,而且尝试了几次发现,丢失的数字毫无规律,应该是随机丢失了 5 位数字,请问有人出现过这种情况吗?是什么原因导致的?

追加一个现象,实际输入过程中,输入 110105 后会自动追加一个空格,输入 1994 后也会追加一个空格,输入 0801 后也会追加一个空格,应该和这个有关系。


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