如何发送“特殊字符"?与Python的动作Send_keys? [英] How to send "special characters" with Python Actions Send_keys?

查看:143
本文介绍了如何发送“特殊字符"?与Python的动作Send_keys?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I am making a code in Python 3.7 for testing an application in Appium.

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

I am trying to send a text in an input field of an application. The text is in French with special characters (é, è, à, etc.).

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

My code managed to type character by character, one by one, but when it arrives to a special character with accent "é", it bugs! Here is error message:

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

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

I read the doc and forum and I added this capability:

desired_caps['unicodeKeyboard'] ='true'

但是它并没有改变任何东西.我仍然有同样的问题.

But it didn't change anything. I still have same issue.

推荐答案

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

这可能对您有帮助

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

这篇关于如何发送“特殊字符"?与Python的动作Send_keys?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆