mardi 8 décembre 2015

Accessiblity identifier cannot be found with Xcode7 UIAutomationTesting

I'm trying to choose between KIFF and UIAutomationTesting (the new automation introduced by Xcode).

I have a collection view and i'm trying to tap one of it's cells. With KIFF no problem at all, everything works.

With UIAutomation I'm trying the following :

XCUIElement* collectionView = app.otherElements[@"filesTilesView"];

[self waitForElement:collectionView];

[[collectionView.cells elementBoundByIndex:0] tap];

when : waitForElement is as following :

  • (void) waitForElement : (XCUIElement*) theElement { NSPredicate *exists = [NSPredicate predicateWithFormat:@"exists == 1"]; [self expectationForPredicate:exists evaluatedWithObject:theElement handler:nil]; [self waitForExpectationsWithTimeout:40 handler:nil];

}

problem is UIAutomation does not find my collection (with accessibility identifier "filesTilesView") view and test fails.... anyone knows why will this happen?

Cheers!

Aucun commentaire:

Enregistrer un commentaire