【发布时间】:2019-01-29 10:56:05
【问题描述】:
我只从客户端通过sendKeys("csvel93@gmail.com") 发送值。值也达到Appium server为“csvel93@gmail.com”。
但Appium server 将值作为“5172 8208 0000 9997csvel93@gmail.com”发送到手机。
此处“5172 8208 0000 9997”- 现有字段值。
我用Appium v1.10.0(.exe格式)
Appium 日志:
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Returning result: {"status":0,"value":{"ELEMENT":"7"}}
[HTTP] --> POST /wd/hub/session/8ffe1a35-ccbd-4e1d-b581-513499f72c21/element/7/value
[HTTP] {"id":"7","text":"csvel93@gmail.com","value":["c","s","v","e","l","9","3","@","g","m","a","i","l",".","c","o","m"]}
[W3C (8ffe1a35)] Calling AppiumDriver.setValue() with args: [["c","s","v","e","l","9","3","@","g","m","a","i","l",".","c","o","m"],"7","8ffe1a35-ccbd-4e1d-b581-513499f72c21"]
[AndroidBootstrap] Sending command to android: {"cmd":"action","action":"element:setText","params":{"elementId":"7","text":"csvel93@gmail.com","replace":false}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got data from client: {"cmd":"action","action":"element:setText","params":{"elementId":"7","text":"csvel93@gmail.com","replace":false}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command of type ACTION
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command action: setText
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using element passed in: 7
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Attempting to clear using UiObject.clearText().
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Sending plain text to element: 5172 8208 0000 9997csvel93@gmail.com
[AndroidBootstrap] Received command result from bootstrap
[W3C (8ffe1a35)] Responding to client with driver.setValue() result: true
[HTTP] <-- POST /wd/hub/session/8ffe1a35-ccbd-4e1d-b581-513499f72c21/element/7/value 200 6268 ms - 14
[HTTP]
【问题讨论】:
-
发送文本前清空字段,如
element.clear() -
能分享一下代码sn-p