草庐IT

uiautomator2

全部标签

android - 如何从android代码启动 "uiautomator test run"?

引用链接:Link1,RobotiumLink2据我们所知,从RobotiumLink2,我们可以从android代码运行robotium测试运行。现在让我们谈谈uiautomator我已经从Link1手动完成了以下步骤adbpushbin/AutomatedTests.jar/data/local/tmp/问题:如何从“AndroidActivity代码”运行以下行:adbshelluiautomatorruntest/data/local/tmp/AutomatedTests.jar-ccom.example.tests.SimpleTest案例一:我试过这个代码:CodeLink

Android Uiautomator 无法以编程方式识别 View ID

我有使用Java构建的布局,而不是来自XML文件。我通过Java代码为每个View分配一个任意ID:例如:Buttonbtn=newButton(this);btn.setText("testBtn");btn.setId(123456);问题是来自Android工具的uiautomator无法识别ID-我得到的是空ID。当我使用XML文件添加按钮时,一切正常。所以我的问题是,id的动态设置有什么问题,两者之间有什么变化,为什么uiautomator不能识别动态id?附言目前我不喜欢将所有布局更改为XML的 最佳答案 这是一个UIA

Python的UI操作——UiAutomation 库

2024软件测试面试刷题,这个小程序(永久刷题),靠它快速找到工作了!(刷题APP的天花板)-CSDN博客文章浏览阅读1.3k次,点赞60次,收藏8次。你知不知道有这么一个软件测试面试的刷题小程序。里面包含了面试常问的软件测试基础题,web自动化测试、app自动化测试、接口测试、性能测试、自动化测试、安全测试及一些常问到的人力资源题目。最主要的是他还收集了像阿里、华为这样的大厂面试真题,还有互动交流板块……https://blog.csdn.net/AI_Green/article/details/134931243?spm=1001.2014.3001.5501安装pipinstalluia

『App自动化测试之Appium应用篇』| uiautomator + accessibility_id定位方法完全使用攻略

『App自动化测试之Appium应用篇』|uiautomator+accessibility_id定位方法完全使用攻略1uiautomatorviewer无法连接手机1.1问题现象1.2解决方法1.2.1方法一:使用第三方文件(不建议)1.2.2方法二:导入uix和png文件2accessibility_id定位说明3accessibility_id定位方式4bounds坐标定位说明5bounds坐标定位方式6uiautomator定位简介7UiSelector对象API8uiautomator定位示例8.1text方法8.2resourceID方法8.3其他方法1uiautomatorvie

java - 用 UiAutomator 测试 Snackbar,有办法吗?

我开始研究Android上的UIAutomator。我创建了一个简单的poc项目,里面只有很少的元素:一个按钮和一个editText。行为非常简单:当我按下按钮时,在editText中写入的消息会出现在snackBar中。现在我想做两个简单的测试:查看snackbar是否正确显示查看editTest消息是否为在snackbar中正确报告对于第一点,我是这样做的:@TestpublicvoidpressEmailButton()throwsUiObjectNotFoundException{mDevice.findObject(By.res(POC_PACKAGE,"fab")).cli

java - 如何在 Windows 中 check out 和构建 UIAutomator 源代码

我正在尝试在UiAutomator.jar中使用UiAutomatorTestRunner.java。androidsdk自带的默认UiAutomator.jar里面没有UiAutomatorTestRunner.java。所以我打算从https://android.googlesource.com/platform/frameworks/testing/+/99937ceb604da144fd88c028d79fd3b2478f059d/uiautomator/library/testrunner-src/com/android/uiautomator/testrunner/UiAu

android设备使用uiautomator2出现uiautomator2.exceptions.GatewayError

出现问题[D23110817:41:11__init__:661][pid:XXX][XXX]killprocess(ps):uiautomatorTraceback(mostrecentcalllast):File"C:\Users\jonathan.shagx\AppData\Roaming\Python\Python37\site-packages\uiautomator2\__init__.py",line486,in_jsonrpc_retry_call returnself._jsonrpc_call(*args,**kwargs)File"C:\Users\jonathan.sh

android - 从 Android Studio (v0.8) 运行 UiAutomator API

当我处理测试时-我在特殊模块中添加类并运行测试配置。类扩展(例如)TestCase并且运行良好。但是当我扩展UiAutomatorTestCase-我得到错误java.lang.RuntimeException:Stub!atcom.android.uiautomator.testrunner.UiAutomatorTestCase.(UiAutomatorTestCase.java:5)...我的简单类:importcom.android.uiautomator.core.UiObjectNotFoundException;importcom.android.uiautomator.

android - 在使用 uiautomator 和 espresso 执行 AndroidTest 之前,如何在 Android 设备上设置允许模拟位置?

基本上每次我必须执行一个使用模拟位置提供程序的AndroidTest时,我需要手动选中设备模拟器上的框:设置-->模拟位置。如何直接从android测试中自动执行此任务?有没有办法使用espresso/uiautomator/其他东西? 最佳答案 我设法以我想要的方式做到了。感谢评论中发布的链接。我在我的gradle文件中添加了以下fragment:taskenableMockLocationForTestsOnDevice(type:Exec){Propertiesproperties=newProperties()propert

android - UiAutomator 2.0 命令行测试

我正在尝试使用AndroidUIAutomator进行一些简单的测试,我知道自UIAutomator2.0以来它需要由Gradle构建,我可以运行我的简单测试,它只通过AndroidStudio或命令行按下主页按钮通过“gradlew.batcC”,我想知道如何使用adb命令运行它?我试过了adbshellaminstrument-wtest.simple.uiatest/android.test.InstrumentationTestRunner按照建议here,但我得到INSTRUMENTATION_STATUS:id=ActivityManagerServiceINSTRUMEN