【问题标题】:How to select "OK" Button from Android Keyboard in Appium如何从 Appium 中的 Android 键盘中选择“确定”按钮
【发布时间】:2018-06-25 06:23:50
【问题描述】:

我正在尝试单击“确定”按钮,即 Android 设备中的刻度线,但它发生了,因为键盘没有任何 xpath 值。 有人可以帮我吗?

【问题讨论】:

  • 你在使用什么 UIAutomator 或 AppiumInspector ?当您将光标移到此位置时分享快照
  • AppiumInspector @pankajmishra
  • 你能分享一下点击这个特定按钮时 AppiumInspector 的截图吗?

标签: appium appium-android python-appium


【解决方案1】:

appium 上的按键是由 driver.press_keycode(code)

All required codes can be found here

  • 66 - KEYCODE_ENTER

所以在你的情况下, 最终代码是这样的,

driver.press_keycode(66)

【讨论】:

    猜你喜欢
    • 2017-07-09
    • 2020-02-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多