UITesting Xcode 7: How to tell if XCUIElement is visible?

后端 未结 5 772
感动是毒
感动是毒 2021-01-02 02:43

I am automating an app using UI Testing in Xcode 7. I have a scrollview with XCUIElements (including buttons, etc) all the way down it. Sometimes the XCUIElements are visi

5条回答
  •  一整个雨季
    2021-01-02 03:04

    You should check isHittable property.

    If view is not hidden, the corresponding XCUIElement is hittable. But there is a caveat. "View 1" can be overlapped by "View 2", but the element corresponding to "View 1" can be hittable.

提交回复
热议问题