Android :java.lang.SecurityException: Injecting to another application requires INJECT_EVENTS permission

前端 未结 9 1451
感动是毒
感动是毒 2020-12-01 11:48

Hi there I am new to Android Junit testing:

I have written some test code in MainActivityFunctionalTest.java file

MainActivityFunctionalTest.java:

         


        
9条回答
  •  抹茶落季
    2020-12-01 12:23

    When you test many functions in the same activity, it is recommended to put in this code:

    SystemClock.sleep(800);
    

    at the beginning of every function. You can customize it but the idea is to wait a certain number of times before processing.

提交回复
热议问题