【发布时间】:2019-07-26 11:04:06
【问题描述】:
我正在尝试自动化一个邮政编码输入字段,该字段会弹出一个数字键盘供用户输入。
Appium可以正确输入邮政编码,但是折叠键盘时遇到问题,我注意到有appium menthod driver.hidekeyboard()
但不幸的是,当我使用它时它会出错。
网络驱动程序错误:
org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: [object Object]
Appium 服务器日志:
debug] [JSONWP Proxy] Matched '/element/undefined/click' to command name 'click'
[debug] [JSONWP Proxy] Proxying [POST /element/undefined/click] to [POST http://localhost:8100/session/83293E4F-4B7A-462A-B5B1-1D729D54E36B/element/undefined/click] with body: {}
[debug] [XCUITest] Connection to WDA timed out
[debug] [iProxy] recv failed: Operation not permitted
[debug] [JSONWP Proxy] Got response with status 200: {"value":{},"sessionId":"83293E4F-4B7A-462A-B5B1-1D729D54E36B","status":13}
[JSONWP Proxy] Got an unexpected response: {"value":{},"sessionId":"83293E4F-4B7A-462A-B5B1-1D729D54E36B","status":13}
[debug] [MJSONWP] Matched JSONWP error code 13 to UnknownError
[debug] [XCUITest] Connection to WDA timed out
[debug] [iProxy] recv failed: Operation not permitted
[debug] [W3C (bac0efb8)] Encountered internal error running command: UnknownError: An unknown server-side error occurred while processing the command. Original error: [object Object]
[debug] [W3C (bac0efb8)] at errorFromMJSONWPStatusCode (/usr/local/lib/node_modules/appium/node_modules/_appium-base-driver@3.14.0@appium-base-driver/lib/protocol/errors.js:789:10)
[debug] [W3C (bac0efb8)] at ProxyRequestError.getActualError (/usr/local/lib/node_modules/appium/node_modules/_appium-base-driver@3.14.0@appium-base-driver/lib/protocol/errors.js:683:14)
[debug] [W3C (bac0efb8)] at JWProxy.command (/usr/local/lib/node_modules/appium/node_modules/_appium-base-driver@3.14.0@appium-base-driver/lib/jsonwp-proxy/proxy.js:234:19)
[HTTP] <-- POST /wd/hub/session/bac0efb8-601a-4558-a50c-f909f2ccb25a/appium/device/hide_keyboard 500 1
我还注意到键盘有一个覆盖方法,其参数如下: https://github.com/appium/java-client/blob/1991a8a0f9e4a3ff467dbb713cb5c51c8edc060f/src/main/java/io/appium/java_client/HidesKeyboardWithKeyName.java
driver.hideKeyboard(HideKeyboardStrategy.PRESS_KEY, "Done");
但不管我是否导入了必要的类,它仍然显示“HidesKeyboard 类型中的方法 hideKeyboard() 不适用于参数 (String, String)”
任何人都可以帮助解决上述 2 个问题中的任何一个吗?
非常感谢!
【问题讨论】:
标签: appium appium-ios