【问题标题】:UI testing Xcode 7, How to get access to element in collectionviewUI 测试 Xcode 7,如何访问 collectionview 中的元素
【发布时间】:2015-12-17 18:00:25
【问题描述】:

我有一个收藏视图,里面有投资的元素。对象以图像的形式出现。所以问题在于这些元素的录音。我无法从此窗口中选择元素,辅助功能检查器将我的整个窗口显示为带有缺少辅助功能值的按钮的元素。

Image of Accessibility Inspector

所以,如果我只使用“录制”按钮,那么我会收到此代码,但无法播放。我仍然没有标签和索引。

XCUIApplication().childrenMatchingType(.Window).elementBoundByIndex(0).childrenMatchingType(.Other).element.childrenMatchingType(.Other).element.childrenMatchingType(.Other).element.childrenMatchingType(.Other).element。 childrenMatchingType(.Other).element.childrenMatchingType(.Other).element.childrenMatchingType(.Button).element.tap()

有谁知道,如何解决这个问题?

【问题讨论】:

  • 好的,一些额外的细节。有一个被按钮覆盖的collectionview,所以我不能选择它下面的元素。

标签: ios user-interface testing xcode7 ui-testing


【解决方案1】:

尝试通过以下方式访问控制(最好使用po以渐进方式调试和检查每个元素的值)

[XCUIApplication.buttons elementBoundbyIndex:0]

或者 [[[XCUIApplication.windows elementBoundbyIndex:0] buttons] elementBoundbyIndex:0] ... 等等。

【讨论】:

    猜你喜欢
    • 2015-12-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-09-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-12-10
    相关资源
    最近更新 更多