0

When I tried to run some Android unit test, I kept getting

junit.framework.AssertionFailedError: Click at (160.0, 120.0) can not be completed! (java.lang.SecurityException: Injecting to another application requires INJECT_EVENTS permission) at com.robotium.solo.Clicker.clickOnScreen(Clicker.java:106) at com.robotium.solo.Clicker.clickOnScreen(Clicker.java:205) at com.robotium.solo.Clicker.clickOnScreen(Clicker.java:170) at com.robotium.solo.Solo.clickOnView(Solo.java:1096) at course.labs.notificationslab.tests.NewFeedTest.testRun(NewFeedTest.java:41) at android.test.InstrumentationTestCase.runMethod(InstrumentationTestCase.java:214) at android.test.InstrumentationTestCase.runTest(InstrumentationTestCase.java:199) at android.test.ActivityInstrumentationTestCase2.runTest(ActivityInstrumentationTestCase2.java:192) at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:191) at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:176) at android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:555) at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1879)

Does anyone happen to know the reason and how to solve this issue?

Thanks.

Unheilig
  • 16,196
  • 193
  • 68
  • 98
  • 1
    Its a problem with permissions, see this: http://stackoverflow.com/questions/5383401/android-inject-events-permission – rerennnn Sep 25 '15 at 19:57

1 Answers1

1

This is often caused if the soft keyboard is open and covering the item you are trying to click. I'd suggest making sure it is closed before continuing.

Zurvæ
  • 610
  • 1
  • 8
  • 23