2015-09-25 31 views
0

當我試圖運行Android的一些單元測試,我一直得到點擊(160.0,120.0)無法完成! (java.lang.SecurityException異常:注射到另一個應用程序需要INJECT_EVENTS許可)

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)

有誰知道發生的原因以及如何解決這個問題?

謝謝。

+1

其權限問題,請參閱:http://stackoverflow.com/questions/5383401/android-inject-events-permission – rerennnn

回答

1

如果軟鍵盤打開並覆蓋您嘗試點擊的項目,通常會導致這種情況。我建議在繼續之前確保它已關閉。

相關問題