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

相关内容

热门资讯

推荐透视!德州局怎么透视,微信... 推荐透视!德州局怎么透视,微信小程序自建房记牌器,练习教程(新版有挂)-哔哩哔哩1)德州局怎么透视免...
科普透视!wepoker作弊方... 科普透视!wepoker作弊方法,微信小程序微乐房间有技巧吗,绝活教程(了解有挂)-哔哩哔哩1、不需...
关于透视!拱趴大菠萝十三水作弊... 关于透视!拱趴大菠萝十三水作弊,微乐自建房辅助多少钱一个月,机巧教程(了解有挂)-哔哩哔哩1、首先打...
详情透视!wepoker怎么拿... 详情透视!wepoker怎么拿到好牌,微乐广西麻辣,练习教程(有挂方针)-哔哩哔哩1、wepoker...
揭露透视!哈糖大菠萝破解器,微... 揭露透视!哈糖大菠萝破解器,微信卡五星小程序辅助,攻略教程(今日头条)-哔哩哔哩哈糖大菠萝破解器脚本...
辅助透视!德普之星透视软件免费... 辅助透视!德普之星透视软件免费入口官网,微乐河南小程序辅助器免费,讲义教程(新版有挂)-哔哩哔哩1、...
曝光透视!uupoker透视,... 曝光透视!uupoker透视,微信小程序微乐辅助器教程,操作教程(有挂方式)-哔哩哔哩1、不需要AI...
解迷透视!pokemmo手机脚... 解迷透视!pokemmo手机脚本,微乐自建房免费黑科技下载,妙招教程(真的有挂)-哔哩哔哩1、pok...
解迷透视!德州透视竞技联盟,微... 解迷透视!德州透视竞技联盟,微信小程序 微乐陕西挖坑 外挂,要领教程(有挂方法)-哔哩哔哩1、德州透...
解谜透视!wepoker辅助器... 解谜透视!wepoker辅助器下载,广西微乐小程序辅助器,技法教程(有挂教程)-哔哩哔哩1、wepo...