【问题标题】:Click at (160.0, 120.0) can not be completed! (java.lang.SecurityException: Injecting to another application requires INJECT_EVENTS permission)点击 (160.0, 120.0) 无法完成! (java.lang.SecurityException:注入另一个应用程序需要INJECT_EVENTS权限)
【发布时间】:2015-09-25 19:52:52
【问题描述】:

当我尝试运行一些 Android 单元测试时,我不断得到

junit.framework.AssertionFailedError: 点击 (160.0, 120.0) 不能 完成! (java.lang.SecurityException:注入另一个 应用程序需要 INJECT_EVENTS 权限) 在 com.robotium.solo.Clicker.clickOnScreen(Clicker.java:106) 在 com.robotium.solo.Clicker.clickOnScreen(Clicker.java:205) 在 com.robotium.solo.Clicker.clickOnScreen(Clicker.java:170) 在 com.robotium.solo.Solo.clickOnView(Solo.java:1096) 在 course.labs.notificationslab.tests.NewFeedTest.testRun(NewFeedTest.java:41) 在 android.test.InstrumentationTestCase.runMethod(InstrumentationTestCase.java:214) 在 android.test.InstrumentationTestCase.runTest(InstrumentationTestCase.java:199) 在 android.test.ActivityInstrumentationTestCase2.runTest(ActivityInstrumentationTestCase2.java:192) 在 android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:191) 在 android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:176) 在 android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:555) 在 android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1879)

有谁知道这个问题的原因以及如何解决?

谢谢。

【问题讨论】:

标签: java android unit-testing junit robotium


【解决方案1】:

如果软键盘打开并覆盖您尝试单击的项目,通常会导致这种情况。我建议在继续之前确保它已关闭。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-07-06
    • 1970-01-01
    • 2011-09-21
    • 1970-01-01
    相关资源
    最近更新 更多