【问题标题】:How to send "special characters" with Python Actions Send_keys?如何使用 Python Actions Send_keys 发送“特殊字符”?
【发布时间】:2020-06-05 20:16:07
【问题描述】:

我正在用 Python 3.7 编写代码来测试 Appium 中的应用程序。

我正在尝试在应用程序的输入字段中发送文本。文本为法语,带有特殊字符(é、è、à 等)。

我的代码设法逐个字符地键入,但是当它到达带有重音“é”的特殊字符时,它会出错!这是错误信息:

Encountered internal error running command: io.appium.uiautomator2.common.exceptions.InvalidArgumentException: KeyCharacterMap.getEvents is unable to synthesize KeyEvent sequence out of '233' key code. Consider applying a patch to UiAutomator2 server code or try to synthesize the necessary key event(s) for it manually

我阅读了文档和论坛,并添加了此功能:

desired_caps['unicodeKeyboard'] ='true'

但这并没有改变任何东西。我仍然有同样的问题。

【问题讨论】:

    标签: python-3.x appium appium-android python-appium


    【解决方案1】:

    尝试发送如下密钥:

    self.driver.find_element().send_keys(u'éèà')
    

    【讨论】:

      【解决方案2】:

      true 更改为True desired_caps['unicodeKeyboard'] ='True'

      这可能对你有帮助

      http://appium.io/docs/en/writing-running-appium/other/unicode/

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2017-08-24
        • 2023-03-10
        • 1970-01-01
        • 2013-09-13
        • 1970-01-01
        • 1970-01-01
        • 2018-11-08
        相关资源
        最近更新 更多