Scroll until element is visible iOS UI Automation with xcode7

后端 未结 9 972
小鲜肉
小鲜肉 2021-01-30 10:39

So with the new xcode update apple has revamped the way we do UI testing. In instruments we used java script function \"isVisible\" to determine if our targeted element is visib

9条回答
  •  感动是毒
    2021-01-30 11:26

    you can do something like this:

    extension XCUIElement {
        internal func scrollToElement(element: XCUIElement) {
            while !element.exists {
                swipeDown()
            }
        }
    }
    

    and than use scrollToElement to find element

提交回复
热议问题