UI 测试失败 - 元素和任何后代都没有将键盘焦点放在 TextView 上 [英] UI Testing Failure - Neither element nor any descendant has keyboard focus on TextView

查看:15
本文介绍了UI 测试失败 - 元素和任何后代都没有将键盘焦点放在 TextView 上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到了Textview"类型字段的问题.我无法在 FeedbackTextView 字段中输入文本.

I'm facing a problem with 'Textview' type field. I am unable to enter text in FeedbackTextView field.

let FeedbackTextView = app.staticTexts["Feedback Textview"]

FeedbackTextView.tap()

FeedbackTextView.typeText("This is test feedback")

执行上述代码时出现以下错误.

Following error is displayed when above code is executed.

UI 测试失败 - 元素和任何后代都没有键盘重点.元素:

UI Testing Failure - Neither element nor any descendant has keyboard focus. Element:

推荐答案

我在 Xcode 7.0.1 中遇到了同样的问题,并且能够通过在模拟器设置中关闭连接的硬件键盘来解决它.硬件 -> 键盘 -> 连接硬件键盘(取消选中此项).在给定视图中的多个 TextField 上调用 tap() 时,硬件键盘会导致问题.已报告此错误,希望能在未来版本中解决.

I faced this same problem with Xcode 7.0.1 and was able to resolve it by turning off the connected hardware keyboard in the simulator settings. Hardware -> Keyboard -> Connect Hardware Keyboard (uncheck this). The hardware keyboard was causing issues when calling tap() on more than one TextField in a given view. This bug has been reported, hopefully it will be resolved in a future release.

这篇关于UI 测试失败 - 元素和任何后代都没有将键盘焦点放在 TextView 上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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