xiaojiangren 2016-04-21 02:30 采纳率: 27%
浏览 3138

关于android的UiAutomation

在初始化UiAutomation的时候返回了一个null值 看API是通过Instrumentation.getUiAutomation()来获取UiAutomation的实例的啊

public UiAutomation getUiAutomation() {
if (mUiAutomationConnection != null) {
if (mUiAutomation == null) {
mUiAutomation = new UiAutomation(getTargetContext().getMainLooper(),
mUiAutomationConnection);
mUiAutomation.connect();
}
return mUiAutomation;
}
return null;
}
这是API中的其中 一段返回null应该是mUiAutomationConnection==null

    mUiAutomationConnection实在
     /*package*/ final void init(ActivityThread thread,
        Context instrContext, Context appContext, ComponentName component, 
        IInstrumentationWatcher watcher, IUiAutomationConnection uiAutomationConnection) {
    mThread = thread;
    mMessageQueue = mThread.getLooper().myQueue();
    mInstrContext = instrContext;
    mAppContext = appContext;
    mComponent = component;
    mWatcher = watcher;
    mUiAutomationConnection = uiAutomationConnection;
}
    里面被赋值的到这里就不太明白了 这是怎么回事啊 有没有大神给解释下啊
  • 写回答

2条回答 默认 最新

  • Robot-C 2016-04-21 02:45
    关注

    转至:

    Android UI自动化测试这块一直是google忽略或者技术薄弱的地方,以至于他没有提供一套完整的自动化测试框架。国内公司做UI自动化测试一般都借助于第三方测试框架如robotium,淘宝测试(TMTS),Robolectric等。但这些测试框架或多或少都存在一些跨应用,事件等待等不足,无法满足UI自动化的所有要求。
      Android4.0之后,google仿照微软UIAut......
    答案就在这里:android UiAutomation
    ----------------------你好,人类,我是来自CSDN星球的问答机器人小C,以上是依据我对问题的理解给出的答案,如果解决了你的问题,望采纳。

    评论

报告相同问题?

悬赏问题

  • ¥50 易语言把MYSQL数据库中的数据添加至组合框
  • ¥20 求数据集和代码#有偿答复
  • ¥15 关于下拉菜单选项关联的问题
  • ¥20 java-OJ-健康体检
  • ¥15 rs485的上拉下拉,不会对a-b<-200mv有影响吗,就是接受时,对判断逻辑0有影响吗
  • ¥15 使用phpstudy在云服务器上搭建个人网站
  • ¥15 应该如何判断含间隙的曲柄摇杆机构,轴与轴承是否发生了碰撞?
  • ¥15 vue3+express部署到nginx
  • ¥20 搭建pt1000三线制高精度测温电路
  • ¥15 使用Jdk8自带的算法,和Jdk11自带的加密结果会一样吗,不一样的话有什么解决方案,Jdk不能升级的情况