3

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.

Sayali
  • 593
  • 3
  • 9
  • 22

2 Answers2

2

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.

Community
  • 1
  • 1
Sayali
  • 593
  • 3
  • 9
  • 22
1

If you get an Error message like : "scrollToVisible cannot be used because a scrollable ancestor element is not visible.", when using the scrollToVisible() method of UIAElement class , the pdf or the content is not loaded yet and you are tying to scroll that content which is not yet loaded.

The solutions to fix this issue are :

1. Add some delay until the content is loaded

2. Use the retry method after every x sec for y times. (Refer: retry method from tuneup js by Alex vollmeter)

3. If the activity indicator (loading spinner exists) then wait until that element is visible. Using any of the three solutions will resolve this error. Also, the similar thing applies for scrollToElementWithName(). If the element is not loaded yet and you are tying to access it.

Hope that helps :)

--Swathy.

vaibhav_15
  • 351
  • 2
  • 9
swathy valluri
  • 5,039
  • 2
  • 16
  • 13