Search code examples
scrollios-ui-automation

UIAScrollView's scrollToElementWithName() not working


I am trying my first hand on UIAutomation. I had a scrollview inside which I had more sub-scrollviews. I am able to tap first 6 visible sub-scrollview but later when I try to tap on 7th it says "tap point is not within bounds of screen". So I tried with following solution but none of these works. 1. scrollToElementWithName("name") does not scrolls 2. scrollUP or scrollDown directly scroll to top/bottom. It doesn't stop in the middle 3. I also tried to scrollToVisible() method of UIAElement class on sub-scrollView object but it says, "scrollToVisible cannot be used because a scrollable ancestor element is not visible."

I have not tried with scrollToElementWithValueForKey as I am confused with what key-value pair should I use. Please suggets. Any help is appreciable. Thank you.


Solution

  • I have found other way to perform scrolling. I used dragFromToForDuration() method to drag the screen so as to make the tap point of next sub-scrollview visible. And this works fine now. But I am running into another issu now which is opened here.