I am using this method to find element which is not on screen currently:
driver.findElement(
MobileBy.AndroidUIAutomator(
"new UiScrollable(new UiSelector().scrollable(true)).scrollIntoView(new UiSelector().$typeString)"
)
)
How to stop scrolling if app crashed (or more generally, how to stop it programatically)?
It is hapenning all the time, that if app crash, scrolling still executing and it is opening menu/notification bar on homescreen.
New test what is running after this failed test then also fail, because notification bar is over the app.
Hardly you will be able to do anything after this command started. You cant scroll amd check simultaniesly if app alive. You can check only before that app not crashed.
Also it wjll help if you specify id of scolling layout in your command. In such case scrolling of notification will not start.