# Basic sample for UiAutomator
*If you are new to UiAutomator, try this sample first.*
This project uses the Gradle build system. You don't need an IDE to build and execute it but Android Studio is recommended.
1. Download the project code, preferably using `git clone`.
1. Open the Android SDK Manager (*Tools* Menu | *Android*) and make sure you have installed the *Android testing support library Repository* under *Extras*.
1. In Android Studio, select *File* | *Open...* and point to the `./build.gradle` file.
1. Check out the relevant code:
* The application under test is located in `src/main/java`
* Tests are in `src/androidTest/java`
1. Create the test configuration with a custom runner: `androidx.test.runner.AndroidJUnitRunner`
* Open *Run* menu | *Edit Configurations*
* Add a new *Android Tests* configuration
* Choose a module
* Add a *Specific instrumentation runner*: `androidx.test.runner.AndroidJUnitRunner`
1. Run the newly created configuration
The application will be started on the device/emulator and a series of actions will be performed automatically.
If you are using Android Studio, the *Run* window will show the test results.
没有合适的资源?快使用搜索试试~ 我知道了~
安卓UiAutomator/UiDevice/Instrumentation官方测试范例
共30个文件
xml:11个
png:5个
gradle:3个
需积分: 0 2 下载量 116 浏览量
2023-10-12
11:06:14
上传
评论
收藏 97KB ZIP 举报
温馨提示
到现在为止,搜索的时候发现没有可用的范例,无处下手。那么先参考官方的范例吧。如何使用,参考其中的说明文件。
资源推荐
资源详情
资源评论
收起资源包目录
UiAutomator-BasicSample.zip (30个子文件)
UiAutomator-BasicSample
BUILD.bazel 2KB
gradle.properties 992B
gradle
wrapper
gradle-wrapper.jar 58KB
gradle-wrapper.properties 200B
app
src
androidTest
java
com
example
android
testing
uiautomator
BasicSample
ChangeTextBehaviorTest.java 5KB
AndroidManifest.xml 559B
main
java
com
example
android
testing
uiautomator
BasicSample
ShowTextActivity.java 2KB
MainActivity.java 3KB
res
values-v13
styles.xml 744B
drawable-mdpi
ic_launcher.png 1KB
drawable-xhdpi
ic_launcher.png 3KB
drawable-xxhdpi
ic_launcher.png 4KB
drawable-xxxhdpi
ic_launcher.png 6KB
values-v21
styles.xml 778B
values-w820dp
dimens.xml 1KB
values
dimens.xml 873B
strings.xml 1020B
styles.xml 792B
layout
activity_main.xml 2KB
activity_show_text.xml 1KB
drawable-hdpi
ic_launcher.png 2KB
AppManifest.xml 721B
AndroidManifest.xml 1KB
build.gradle 2KB
gradlew.bat 3KB
build.gradle 789B
settings.gradle 15B
gradlew 8KB
.gitignore 53B
README.md 1KB
共 30 条
- 1
资源评论
柳鲲鹏
- 粉丝: 5901
- 资源: 108
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功