I have a situation where some of the UI elements (labels, cells, buttons) will exist in the view hierarchy, but won't be visible in the UI until a certain criteria is met. Their label texts for instance won't change, just their visibility (hidden/shown). How can I check for the element's visibility in an UI test, if the element's .exists and .enabled values will both return true but the element isn't still shown yet? I tried checking for hittable, but that causes the error about performing an AX action:
UI Testing Failure - Failed to scroll to visible (by AX action) StaticText 0x12ef00d40: traits: 146028888128, error: Error -25204 performing AXAction 200
If I could be certain that .hittable will always produce error when the element exists but isn't visible yet, I could use that for checking that the element is shown/hidden correctly. Then the question changes to how can check for the hittable's value without the test failing due to the AX error? Or is there other ways for checking the visibility of an element?