Thanks for help but it couldnt find the element
The element which i search for is not on the screen so i need to scroll, do you think this problem is result of that or any other problem? Is moveToElement function provide this?
Here you can see the below code snippet it will take a while loop and search for that element if its found it will be break loop, else it will swipe and will try to find that element. its working fine for me
if u have a scrollable element you can use Android UISelector - UiScrollable object. It belongs to the UIAutomator object.
To find your element please use :
WebElement el = driver.findElement(MobileBy. AndroidUIAutomator("new UiScrollable(new UiSelector()). scrollIntoView("+ “new UiSelector().text(”"+element+""));"));
When “new UiSelector().text(”"+element+""));" can be located by other locators as id , index and etc…
also please refer to the next example link :