【问题标题】:XCTest UI Test System PhotoAuth Alert error。[__NSArrayM insertObject:atIndex:]: object cannot be nil (NSInvalidArgumentException)XCTest UI 测试系统 PhotoAuth Alert 错误。[__NSArrayM insertObject:atIndex:]: object cannot be nil (NSInvalidArgumentException)
【发布时间】:2022-07-08 16:42:47
【问题描述】:

// tap photo auth entrance
XCUIElement *collectionView = app.collectionViews.firstMatch;
XCUIElement *authCell = [collectionView.cells elementBoundByIndex:2];
[authCell tap];
    
// springboard click allow
XCUIApplication *springboard = [[XCUIApplication alloc] initWithBundleIdentifier:@"com.apple.springboard"];
XCUIElement *button = [[springboard.alerts.firstMatch buttons] elementBoundByIndex:1];
BOOL exist = [button waitForExistenceWithTimeout:5];
XCTAssertEqual(exist, YES, @"photo auth alert not exist");
[button tap];

在我的iphone12(iOS15.4)上可以正常使用,但是在其他iphone12-Pro(iOS15.4)上就不行了

错误: *** -[__NSArrayM insertObject:atIndex:]: 对象不能为 nil (NSInvalidArgumentException)

我应该如何解决这个问题? 非常感谢!

【问题讨论】:

  • 帮助........

标签: xcode alert xctest uitest springboard


【解决方案1】:

我也遇到过这个问题。现在解决了吗?

【讨论】:

    猜你喜欢
    • 2023-04-05
    • 1970-01-01
    • 2012-12-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多