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

后端 未结 5 806
感动是毒
感动是毒 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

    What i had to do to address this problem is to actually swipe up or down in my UI testing code. Have you tried this?

    XCUIApplication().swipeUp()
    

    Or you can also do WhateverUIElement.swipUp() and it will scroll up/down with respect to that element.

    Hopefully they will fix the auto scroll or auto find feature so we don't have to do this manually.

提交回复
热议问题