Android Instrumentation测试使用androidx orchestrator部分失败。
创始人
2024-08-14 05:33:15
0

要解决“Android Instrumentation测试使用androidx orchestrator部分失败”的问题,可以按照以下步骤进行操作:

  1. 确保在项目的build.gradle文件中添加了Orchestrator依赖:
android {
    defaultConfig {
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        // ...
    }
}

dependencies {
    androidTestImplementation 'androidx.test:runner:1.1.0'
    androidTestUtil 'androidx.test:orchestrator:1.1.0'
    // ...
}
  1. 在你的Instrumentation测试类中,添加Orchestrator注解:
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.rule.ActivityTestRule;
import androidx.test.runner.AndroidJUnitRunner;
import androidx.test.runner.AndroidJUnitRunner;
import androidx.test.runner.AndroidJUnitRunner;
import androidx.test.runner.AndroidJUnitRunner;
import androidx.test.runner.AndroidJUnitRunner;

import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.rule.ActivityTestRule;

import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;

import androidx.test.platform.app.InstrumentationRegistry;

@RunWith(AndroidJUnit4.class)
@androidx.test.runner.AndroidJUnitRunner
public class MyInstrumentationTest {
    // ...
}
  1. 确保你的设备或模拟器上已经安装了最新版本的AndroidJUnitRunner库。

  2. 在Android Studio中,点击菜单栏的"Run" -> "Edit Configurations",然后在左侧的列表中选择你的Instrumentation测试配置。

  3. 在右侧的"General"选项卡中,确保"Target"下拉菜单中选择了你的设备或模拟器。

  4. 在右侧的"Test options"选项卡中,添加以下参数:

-wait-for-debugger
-no-window-animation
  1. 运行你的Instrumentation测试。

相关内容

热门资讯

了解透视!wepokerplu... 了解透视!wepokerplus万能挂,微乐自建房辅助工具2025在哪,积累教程(存在有挂)-哔哩哔...
分享透视!拱趴大菠萝机器人,微... 分享透视!拱趴大菠萝机器人,微乐家乡自建房辅助app,练习教程(有挂总结)-哔哩哔哩1、任何拱趴大菠...
有挂透视!大菠萝789辅助器下... 有挂透视!大菠萝789辅助器下载,微乐小程序插件免费,讲义教程(有挂透明挂)-哔哩哔哩1、许多玩家不...
总结透视!werplan辅助软... 总结透视!werplan辅助软件,微乐小程序有脚本吗,机巧教程(有挂总结)-哔哩哔哩1、上手简单,内...
开挂透视!wpk刷入池率脚本,... 开挂透视!wpk刷入池率脚本,微信小程序微乐辅助器免费版v2.0,模板教程(有挂透明挂)-哔哩哔哩1...
有挂透视!aapoker公共底... 有挂透视!aapoker公共底牌,微乐智能辅助软件是真的吗,策略教程(有挂分析)-哔哩哔哩所有人都在...
有挂透视!hhpoker软件可... 有挂透视!hhpoker软件可以玩吗,微信小程序微乐为什么老输,手筋教程(真的有挂)-哔哩哔哩1、每...
科普透视!wepoker有没有... 科普透视!wepoker有没有辅助,微乐自建房辅助免费入口,模块教程(有挂解密)-哔哩哔哩1、每一步...
分享透视!大菠萝手游辅助,收i... 分享透视!大菠萝手游辅助,收i就微乐小程序游戏破解器,手段教程(有人有挂)-哔哩哔哩1、大菠萝手游辅...
推荐透视!hh poker辅助... 推荐透视!hh poker辅助有用吗,微信小程序怎么开挂,妙招教程(有挂攻略)-哔哩哔哩1、任何hh...