I’m automating React Native app with python client and having trouble with Javascript’s setInterval.
When I use setInterval on a page, Appium takes a very long time to find any element on that page regardless of which locator I use.
For example, it takes 10000ms to find by accessibility ID while setInterval exists, but it become 200ms if I remove setInterval.
How can I avoid this behavior without quitting using setInterval on app side.
It’s the only issue on Android app and nothing problematic on iOS app.
Platform you are automating (iOS or Android): Android (React Native)
Appium version: v1.19.0
Simulator/Emulator or Real Device: Both
The language you are using for writing tests (client binding): Python
Most likely the usage of this API incorrectly affects the main UI thread preventing it from switching to the idle state. I would try to report that to React as a bug. Although, if your interval value is short then the described behaviour is expected. UiAutomator cannot perform its action if the app UI thread is not idling.