How should I scroll to 2nd or 3rd instance of an element using text in native mobile app?

How should I scroll to 2nd or 3rd instance of an element using text in native mobile app ?

Aalok said:

How should I scroll to 2nd or 3rd instance of an element using text in native mobile app ?

Try to use “Scroll to text”.

@ Ann Ohremenko - I think it will scroll till the first instance. It will not scroll further till 2nd/3rd instance.
I found the way for it:-
String txtsearch = “Text”
appdriver.findElement(MobileBy.AndroidUIAutomator(“new UiScrollable(new UiSelector().scrollable(true).instance(0)).scrollIntoView(new UiSelector().textContains(\”"+txtsearch+"\").instance(1))"))

@3658-Aalok I had a long list with items of trucks. And I need for example the 10th item that called “Minitruck”. So in manual mode, I used a command “Scroll to text” and input “Minitruck”. In my case, it works.