XCUIElement in new testing framework. Button element is cannon be tapped

I have a UI test that is going after a UI by interrogating its elements.


I am able to get the buttongs on the page and determine if they exist and if they are enabled:

bool buttonExists = [fooButtonName exists];

bool buttonEnabled [fooButtonName isEnabled];


but neither of these conditions tell me if the button is able to be tapped. for when both these variables are true, I still encounter:


test failure: -[XXXX_UI_Tests testExample] failed: UI Testing Failure - Unable to find hit point for element Button 0x7a787240: traits: 1, {{20.0, 52.0}, {48.0, 30.0}}, title: 'Cancel', label: 'Cancel'

Replies

Same here.

You can check the "hittable" property of the element.

Hey Joar could you please rely to this thread : https://forums.developer.apple.com/thread/107779