xcode:时间戳事件匹配错误:找不到匹配元素

xcode:时间戳事件匹配错误:找不到匹配元素

问题描述:

我正在尝试记录一些 XCUITesting 函数.我收到此错误.

I'm trying to record some XCUITesting functions. I get this error.

Timestamped Event Matching Error: Failed to find matching element

这是 Xcode 错误和/或我的 UI 复杂性的问题吗?

Is this an Xcode bug and/or issues with the complexity of my UI?

我在一个非常复杂的应用程序上也遇到了同样的问题很长时间:关键在于 isAccessibilityElement 正在设置是.UI 测试和可访问性是相辅相成的.我的想法是设备需要能够与元素进行交互,因为从表面上看,用户无法做到.

I was having the same problem for a long time on a very complex app as well: The key is all in isAccessibilityElement being set to YES. UI testing and accessibility go hand-in-hand. The way I think about it is that the device needs to be able to interact with the element, since ostensibly, the user wouldn't be able to.

我做了两次:

  1. cellForRowAtIndexPath - cell.isAccessibilityElement = YES

UITableViewCell 子类中的 awakeFromNib - self.isAccessibilityElement = YES

In awakeFromNib in a UITableViewCell subclass - self.isAccessibilityElement = YES

希望能帮到你,祝你好运!

Hope that helps, and good luck!