jjzjj

scrollViewsQuery

全部标签

ios - Xcode UI 测试 - 找不到刚刚记录的元素

我正在尝试XcodeUI测试。我刚刚录制了一个简单的测试并重播了它,但第一步失败了。代码是:XCUIApplication*app=[[XCUIApplicationalloc]init];XCUIElementQuery*scrollViewsQuery=app.scrollViews;[[scrollViewsQuery.otherElementscontainingType:XCUIElementTypeStaticTextidentifier:@"FirstPage"].elementtap];失败的行是最后一行,错误消息是“UI测试失败-未找到ScrollView的匹配项”为