在XCode 7.2中,如果我能得到XCUIApplication()。scrollViews [「Foo」] .otherElements.otherElements [「Page Title」],那麼說「給我這個名爲」Foo「的scrollView的頁面標題, ?」如何獲取Xcode 7.2 XCTestCase中滾動視圖的標籤?
我試過要求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。