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测试。

相关内容

热门资讯

德扑ai助手!德扑快速计算胜率... 1、德扑ai助手!德扑快速计算胜率,德扑好像是真的有挂(详细有作弊教程);代表性(透视辅助软件透明挂...
微扑克系统发牌规律!微扑克辅助... 微扑克系统发牌规律!微扑克辅助测试,wpk俱乐部软件(详细辅助教程)是一款可以让一直输的玩家,快速成...
wepoke辅助机器人!wep... wepoke辅助机器人!wepoke保险,wepoke游戏真的是有挂的,新2025教程(有挂攻略);...
德扑之星有作弊!德州之星有ap... 德扑之星有作弊!德州之星有app辅助,德州ai本来真的是有挂(详细有辅助挂教程);小薇(透视辅助)致...
wpk德州透视辅助!wpk辅助... wpk德州透视辅助!wpk辅助实时策略建议,wPK总是真的有挂,详细教程,(有挂脚本)1、游戏颠覆性...
wepok软件透明挂!微扑克插... wepok软件透明挂!微扑克插件,pokermastersteam外挂(详细辅助挂教程);致您一封信...
解密教程!wepower有辅助... 解密教程!wepower有辅助软件(wepoke辅助)wepOkE(果真真的有挂)1、不需要AI权限...
德州ai人工智能!德扑之星可以... 自定义德州ai人工智能系统规律,只需要输入自己想要的开挂功能,一键便可以生成出微扑克专用辅助器,不管...
微扑克辅助挂!德扑人工智能,w... 微扑克辅助挂!德扑人工智能,wepower插件(详细辅助教程);原来确实真的有挂(需添加指定薇757...
wpk辅助挂!wpk微扑克真的... wpk辅助挂!wpk微扑克真的有辅助插件,WPK一般真的有挂,详细教程,(有挂插件)1、首先打开微扑...