Horizontal scroll into view not working


I have a list of elements on the screen displayed horizontally i need to swipe through untill and element comes into view which has a specific text.

The following worked for me when the list was vertical, now that it is horizontal I added “.scrollable(true).setAsHorizontalList()” in an attempt to make the scroll go sideways as follows

`> driver.findElement(new UiScrollable(new UiSelector().scrollable(true).setAsHorizontalList().instance(0)).scrollIntoView(new UiSelector().text(“My Text”)))

When I execute the above in my code nothing happens. Any thoughts?

Thank you!

  • Platform: Android
  • Appium version: latest
  • Emulator/Simulator
  • Client language: java
  • Mac OS

step 1: look at -> http://appium.io/docs/en/writing-running-appium/tutorial/swipe-tutorial/

possible reasons: you have several lists on screen.