【发布时间】:2016-09-28 20:55:09
【问题描述】:
在 XCode 7.2 中,如果我可以得到 XCUIApplication().scrollViews["Foo"].otherElements.otherElements["Page Title"],那么可以说“给我这个名为“Foo”的 scrollView 的页面标题“?”
我已尝试询问accessibilityLabel 和staticTexts。
我已尝试将 XCUIApplication().scrollViews["Foo"]、XCUIApplication().scrollViews["Foo"].otherElements 等添加到我的监视列表中,但我没有看到任何有用的信息。
当我对XCUIApplication().scrollViews["Foo"].otherElements 执行po 时,我得到:
<snip>
↪︎Find: Descendants matching type Other
Output: {
Other 0x7f904b60e910: traits: 8589934592, {{0.0, 0.0}, {768.0, 1024.0}}, label: 'PDF article'
Other 0x7f9049efb6e0: traits: 8589934592, {{0.0, 0.0}, {768.0, 1024.0}}
}
(本例中的页面标题为“PDF 文章”)
所以我觉得我至少应该可以使用 staticTexts 访问它。
【问题讨论】: