I7210I
September 22, 2022, 9:59am
1
Hi
I have an element that I would like to scroll to it, it’s on the bar of my app.
The thing is that element is not visible at the start since I need to scroll to it, so I tried to use :
getDriver().findElement(MobileBy.AndroidUIAutomator("new UiScrollable(new UiSelector().scrollable(true)).setAsHorizontalList().setSwipeDeadZonePercentage(10).scrollIntoView(new UiSelector().text(\""+textToSearch+"\"))")).click();
but it doesn’t seems to scroll to the element, so what you suggest me to do in that case?
Thank you
Aleksei
September 22, 2022, 1:22pm
2
possibly you have several scroll views?
if you look into your code new UiSelector().scrollable(true)
= take first scroll view.
I7210I
September 22, 2022, 3:12pm
3
yes that is right i need the first one, that is correct, the problem that it doesn’t find it
Aleksei
September 22, 2022, 3:22pm
4
share page source maybe give some ideas…
I7210I
September 28, 2022, 2:39pm
5
sorry for the delay, here is it
Aleksei
September 28, 2022, 7:00pm
6
looks very similar to -> [Android- Appium]Scroll an element(android.widget.HorizontalScrollView) left , I just want to scroll the element not the screen
try now add resourceIdMatches
getDriver().findElement(MobileBy.AndroidUIAutomator("new UiScrollable(new UiSelector().resourceIdMatches(\"*.tab_layout\").scrollable(true)).setAsHorizontalList().setSwipeDeadZonePercentage(10).scrollIntoView(new UiSelector().text(\""+textToSearch+"\"))")).click();
also try remove setSwipeDeadZonePercentage
or change % (maybe it also affects)