【问题标题】:Xcode UI tests: how to identify a custom view with no static text?Xcode UI 测试:如何识别没有静态文本的自定义视图?
【发布时间】:2017-01-11 20:14:05
【问题描述】:

我需要实现一个 UI 测试来检查某个自定义视图是否显示在另一个视图中。我没有使用storyboard,而是分隔nib 文件,并且这样的自定义子视图没有静态文本来识别它。我检查了XCUIElementQuery API,我看到它提供了函数matching(identifier: String)matching(_ elementType: XCUIElementType, identifier: String?),但是,由于我只使用单独的nib 文件,我不确定这是哪个identifier 以及如何我应该设置它。

【问题讨论】:

    标签: ios xcode7 nib xctest xcode-ui-testing


    【解决方案1】:

    您可以设置xib元素的可访问性标识符:

    【讨论】:

      猜你喜欢
      • 2016-08-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-06-22
      • 2020-05-04
      • 1970-01-01
      相关资源
      最近更新 更多