Has anybody found a good way to scroll to an element?
I can do something like the below function. But I am running into situation where a single swipeUp is too much swipe!! It looks like swipeUp is about 1.5 the size in view. So when I swipe up the element I am wanting goes out of view in the top.
Any ideas?
Thanks!
func swipeUpUntilElementFound(app: XCUIApplication, element : XCUIElement, maxNumberOfSwipes : UInt) -> Bool{
if element.exists{
return true
}
else {
for _ in 1...maxNumberOfSwipes{
app.swipeUp()
if element.exists{
return true
}
}
return false
}
}
Looks like this issue is still valid for desktop apps. My tests failed because it doesn't want to scroll automatically to find a needed element.