How to slid spinner android

I need to select an item from a spinner that, when clicked, does not display the item I want among the first in the list. I have to scroll the spinner to select the item I want. How to automate spinner scrolling to that particular item in Appium for Android?

Please send a screenshot of the spinner and the XML on appium inspector.
If you just want to scroll, by coordinates, you can search in this site, I bet you will find example code that you can use.

1 Like

This is spinner with content. To display the item i want, i have to scroll:


Components tree appium:

Does anyone have an idea how to do this?

what problem just scroll this list?
e.g. get element by class name android.widget.ListView -> find element center, up and down location -> use it to make scroll.

Thanks for your response.

My problem is after the click. When the spinner is clicked, the slide appears. However, I don’t know how to scroll to finish in appium.

Note: It is now possible to click on the spinner items that are displayed. The problem is rolling the spinner.

Same as usual. Just swipe your list.

I achieved!!

The way to slide the dropdown that I implemented was this:

findElement(AppiumBy.androidUIAutomator(“new UiScrollable(new UiSelector()).scrollIntoView(text("PAI"));”))

Thank you for your attention.