jjzjj

UiAutomator

全部标签

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 - Espresso - 如何将 typeText 切换为英语或其他语言输入模式

我正在使用Espresso来实现我的应用程序的自动测试框架。但是在我设计的一些测试用例中,我发现我的测试总是失败,根本原因不在我的功能实现代码上的测试代码中。根本原因是在android输入法模式下,有时候是中文输入模式,而我输入的文字是英文,那么输入值就会失败。所以我想知道如何将当前的typeText输入法模式从中文切换为英文,或者如何在不手动配置的情况下确保输入法模式为英文?我相信这是一个重要的要求,因为当我们在我们的应用程序中支持多种语言时,我们需要此功能在测试期间自动切换到所需的语言。以下是我的代码,如果默认输入模式是英文,没有任何问题。onView(withId(R.id.en

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

android - 如何检测 uiautomator 中的抬头通知?

我正在使用Nexus5和CyanogenOneplus设备以及Lollipopandroid操作系统。我正在尝试测试某些应用程序的各种通知。我成功地能够使用UiAutomator测试托盘通知和锁定屏幕通知,但我无法成功地进行提示通知。我尝试了以下代码,但未能检测到它。publicvoidtest_HeadsupTitle()throwsInterruptedException,UiObjectNotFoundException,IOException{//somecodetobringupheadsupnotificationUiObjectmaxHeadsUp=newUiObject

android - 我们可以在 Android 应用程序中使用 UIAutomator 吗?

我想知道我们可以在我们的应用程序中使用UIAutomator吗?我想编写一个打开另一个应用程序的应用程序,在该应用程序EditText中写一些文本,然后按一些按钮(比如打开环聊并在其上写一个文本并发送消息)。你能建议我该怎么做吗?我在网上搜索过,我只能发现我可以用UIAutomator测试我的UI,但我不知道我是否可以用它来编写一个Android应用程序(不是jar文件)并在我的Android设备上运行它做这个。 最佳答案 这是不可能的。UiAutomator2.0依赖Instrumentation这仅在您使用aminstrumen

Python uiautomator2安卓自动化测试

一、前言uiautomator2是Python对Android设备进行UI自动化的库,支持USB和WIFI链接,可以实现获取屏幕上任意一个APP的任意一个控件属性,并对其进行任意操作。重点是它可以实现安卓自动化采集,甚至是群控采集,且安装和操作十分简单,学习成本极低。当你遇上app接口加密短期内无法逆向时,不妨试试这种方式。二、安装    1.安装uiautomator2    pipinstalluiautomator2-ihttps://pypi.tuna.tsinghua.edu.cn/simple/    2.安装atx-agent    python-muiautomator2ini

android - UiAutomator -- 将小部件添加到主屏幕

我对Google的uiautomator有相当多的经验;但是,在向手机的主屏幕添加小部件时,我似乎感到很困惑。现在让我们保持简单,并假设要添加小部件的屏幕是空的。思考过程是打开应用程序抽屉>单击小部件选项卡>找到要添加的小部件>长按并将小部件拖到主屏幕。看起来小部件不是“可长时间点击”的。任何想法/建议/解决方案将不胜感激。我实现的代码如下。@OverrideprotectedvoidsetUp()throwsUiObjectNotFoundException{getUiDevice().pressHome();newUiObject(newUiSelector().className

android - 运行 uiautomator 时,AccessibilityService 被销毁

我是android的新手,我正在尝试探索AccessibilityService。我扩展了AccessibilityService类,它获取AccessibilityEvents并且我能够使用这些事件。我在运行“uiautomatordump”时遇到问题。我的AccessibilityService被销毁,我没有收到任何辅助功能事件。有没有办法解决这个问题?感谢任何帮助或建议。非常感谢您。堆栈跟踪附在下面:W/System.err(3832):atcom.example.myservice.MyAccessibilityService.onUnbind(MyAccessibilityS