How I can do Swipe to find directly elements and then insert data?

I have.
java version “1.8.0_181”
appium version 1.10.1
Apache Maven 3.5.2
cucumber
How I can auto swipe to find elements with appium? I’m try to delete all the methods of swipeUp (); on my project and only find the elements directly and then insert data.

Help me please.

@sainzx
You can use something like UiScrollable. And you can tell to find the elements by ID also, but i do not know exactly the syntax. Maybe this will help: http://www.automationtestinghub.com/appium-scroll-examples/

@AndroidFindBy(uiAutomator = "new UiScrollable(new UiSelector()).scrollIntoView(text(\"yourText\"))")
public MobileElement yourElement;
1 Like

I have other doubt. when I use @AndroidFindBy(uiAutomator = "new UiScrollable(new UiSelector()).scrollIntoView(text(\"yourText\"))") the code search the element only in the down part of the screen and search my element. But if I want search other element in the top part of the screen this code doesn’t work to search other element in the top part. , how i will can search an element of top part of screen?.

abstract:
this code,
It does not have the scroll towards the top of the screen. and I need search more elements in the top part of the screen. how I can do this ?