HTML5   发布时间:2022-04-27  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了ios-ui-automation – target.frontMostApp().键盘()无法找到键’N’大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
我正在尝试使用UI Automation自动键盘输入.

target.frontMostApp().keyboard().typeString("INTERCOM")

但是在输入“I”后我会收到此错误

target.frontMostApp().keyboard() Failed to locate key 'N'
Script threw an uncaught JavaScript error: target.frontMostApp().keyboard() Failed to locate key 'N'

我有一个本地化的瑞典键盘.

任何人都知道这是一个我错过的错误吗?

解决方法

这可能有所帮助:

var vKeyboard = target.frontMostApp().keyboard();
vKeyboard.seTinterKeyDelay(0.1);
vKeyboard.typeString("INTERCOM");

认情况下,此延迟设置为0.03秒.这不足以让您的应用程序更新键盘上的按键.在确定typeString键盘方法的键之间增加此超时将对您有所帮助. UIAKeyboard参页面上没有seTinterKeyDelay的描述,但此方法可用于UIAKeyboard.我也不确定其他语言.我不知道typeString是否允许在其他语言上键入,但这100%适用于iOS 5.x的英文键盘.

大佬总结

以上是大佬教程为你收集整理的ios-ui-automation – target.frontMostApp().键盘()无法找到键’N’全部内容,希望文章能够帮你解决ios-ui-automation – target.frontMostApp().键盘()无法找到键’N’所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。