Is there way to tap an item on iphone/ipod devices that are not visible on the screen using XCTest?

I can't seem to tap on an element that's not visible on the screen when I'm running my app on iPhone and iPod.

It seems to work fine when I'm running it on iPad.


For eg.,

XCUIElement *button = [[app.tables[@"FormPicker tableview"] childrenMatchingType:XCUIElementTypeCell] elementBoundByIndex:10];

[button tap];


If I this element happens to be off the screen, my iPad will automatically position the screen over it, and tap it.

However, the iPhone isn't able to.


Any ideas? Or is this a bug in XCTest at the moment?

Replies

This no longer works on the iPad since beta 6. Any workarounds?

The expected behavior is that XCTest automatically scrolls the element into view, and then taps it. If that's not working, that's a bug. Please file a bug report.

Still not fixed. This is frankly pitiful. UI testing is completely crippled in my app as a result of this fundamental bug. How can this not have been addressed a year later??