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

相关内容

热门资讯

玩家教你!wepoke智能ai... 玩家教你!wepoke智能ai(we辅助poker德之星)WepoKe(总是真的有挂);科技安装教程...
微扑克ai辅助器苹果版!微扑克... 微扑克ai辅助器苹果版!微扑克真的有辅助(透视辅助)果然是有挂1、微扑克系统规律教程、微扑克辅助透视...
实测揭晓!海南麻将琼瑶有挂吗(... 实测揭晓!海南麻将琼瑶有挂吗(透明挂)总是是有挂(2021已更新)(哔哩哔哩)1、很好的工具软件,可...
wepoke ai辅助!wep... 【福星临门,好运相随】;wepoke ai辅助!wepoke有科技,wepoKe一贯真的有挂,爆料教...
微扑克ai机器人!微扑克wpk... 微扑克ai机器人!微扑克wpk辅助存在,微扑克系统发牌规律(一贯真的有挂)1、打开德州poker外挂...
大神推荐!余干中至麻将有猫腻吗... 大神推荐!余干中至麻将有猫腻吗(透明挂)竟然存在有挂(2023已更新)(哔哩哔哩)1、余干中至麻将有...
靠谱教程!wepower让系统... 靠谱教程!wepower让系统发好牌(wepok软件透明挂)wePOke(就是真的有挂);支持多人共...
微扑克游戏辅助器!wpk微扑克... 1、微扑克游戏辅助器!wpk微扑克系统发牌规律(辅助挂)总是有挂;详细教程。2、微扑克透视辅助简单,...
玩家必看分享!中至赣州辅助器下... 玩家必看分享!中至赣州辅助器下载(透明挂)一贯有挂(2020已更新)(哔哩哔哩)玩家必看分享!中至赣...
必赢方法!德州wepower透... 必赢方法!德州wepower透视辅助(wepower辅助器)wopoker(总是真的有挂)这是由厦门...