Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Espresso: AppNotIdleException

I am continuously getting this error when I land on a page. What could be the solution to this?

android.support.test.espresso.AppNotIdleException: Looped for 4539 iterations over 60 SECONDS. The following Idle Conditions failed .
at dalvik.system.VMStack.getThreadStackTrace(Native Method)
at java.lang.Thread.getStackTrace(Thread.java:580)
at android.support.test.espresso.base.DefaultFailureHandler.getUserFriendlyError(DefaultFailureHandler.java:92)
at android.support.test.espresso.base.DefaultFailureHandler.handle(DefaultFailureHandler.java:56)
at android.support.test.espresso.ViewInteraction.runSynchronouslyOnUiThread(ViewInteraction.java:184)
at android.support.test.espresso.ViewInteraction.check(ViewInteraction.java:158)
like image 757
San Kh Avatar asked Aug 05 '16 21:08

San Kh


2 Answers

It might occur due to any UI element which is creating itself infinitely. For example, you have a Custom ProgressBar or Snackbar which is set to invisible/gone in xml and you are setting it visible in java code. But it might re-paint itself in invisible/gone state also due to ill-written code. So, go through any Custom UI elements as well if you have any.

like image 99
Apurva Sharma Avatar answered Sep 21 '22 17:09

Apurva Sharma


It's very likely because you didn't turn off the following 3 settings in you developer options:

  • Window animation scale
  • Transition animation scale
  • Animator duration scale

For more informations read the tips to set up Espresso.

If that is not the case something seems to be interacting with your screen while the test is running.

like image 21
luckyhandler Avatar answered Sep 22 '22 17:09

luckyhandler