Android 自动化测试框架 UiAutomation

Lynn
Lynn
Lynn
订阅者
223
文章
0
评论
测试交流2317字数 110阅读0分22秒阅读模式

使用 UiAutomation 出现 UiAutomation connect 失败的问题,请问有哪位大神遇到过的吗
mInstrumentation = InstrumentationRegistry.getInstrumentation();
mDevice = UiDevice.getInstance(mInstrumentation);
报错:
AndroidRuntime: FATAL EXCEPTION: Instr: android.support.test.runner.AndroidJUnitRunner
Process: com.xgd.mytest, PID: 22079
java.lang.IllegalStateException: Cannot call disconnect() while connecting UiAutomation@40bc56a[id=-1, flags=0]
at android.app.UiAutomation.disconnect(UiAutomation.java:293)
at android.app.Instrumentation.finish(Instrumentation.java:249)
at android.support.test.runner.MonitoringInstrumentation.finish(MonitoringInstrumentation.java:351)
at android.support.test.runner.AndroidJUnitRunner.finish(AndroidJUnitRunner.java:404)
at android.support.test.runner.AndroidJUnitRunner.onStart(AndroidJUnitRunner.java:393)
at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:2205) 文章源自玩技e族-https://www.playezu.com/181970.html

 
评论  2  访客  2
    • ZDylan
      ZDylan 0

      楼主找到答案了吗

      • jack
        jack 9

        build.gradle 没有配置对吧,你去 github 上抄一下官方的代码

      匿名

      发表评论

      匿名网友
      确定

      拖动滑块以完成验证