android-uiautomator

Uiautomator Didn't find class <class> on path DexPathList

霸气de小男生 提交于 2019-12-25 08:45:00
问题 I am currently developing a Java project in order to perform automatic screenshots of my Android application, however, when performing the uiautomator command: adb shell uiautomator runtest AutoScreenshot.jar -c test.ScreenshotRoutine I am getting the following error: INSTRUMENTATION_RESULT: shortMsg=java.lang.RuntimeException INSTRUMENTATION_RESULT: longMsg=Didn't find class "test.ScreenshotRoutine" on pa th: DexPathList[[zip file "/system/framework/android.test.runner.jar", zip file "

uiautomator click on a ImageButton with no text or content-desc

徘徊边缘 提交于 2019-12-25 05:34:28
问题 On 4.2.2 emulator, in Now Playing screen from Music, we have the prev, play and next ImageButtons. Unfortunately these 3 buttons have no text or contet-desc values. I want to click on one of them and I think the answer lies in something like: UiObject relLayout = new UiObject(new UiSelector() .className("android.widget.LinearLayout").index(1)); relLayout.click(); But there are several LinearLayout in this screen and I don't know how to select a specific LinearLayout. The code snipped above

How to inspect element if there are multiple elements with same class name and doesn't have resource-id

↘锁芯ラ 提交于 2019-12-24 20:02:16
问题 <?xml version="1.0" encoding="UTF-8" standalone="true"?> -<hierarchy rotation="0"> -<node bounds="[0,0][720,1280]" selected="false" password="false" long-clickable="false" scrollable="false" focused="false" focusable="false" enabled="true" clickable="false" checked="false" checkable="false" content-desc="" package="com.talentpace.substk" class="android.widget.FrameLayout" resource-id="" text="" index="0"> -<node bounds="[0,0][720,1280]" selected="false" password="false" long-clickable="false"

Calling from not trusted UID

二次信任 提交于 2019-12-24 18:57:20
问题 When I was running UIAutomator in Android Studio, a crash shows sometimes. W/ActivityManager: Crash of app com.example.testsample running instrumentation ComponentInfo{com.example.testsample.test/android.support.test.runner.AndroidJUnitRunner} 07-16 19:19:34.191 7834-7850/? W/Binder: Binder call failed. java.lang.SecurityException: Calling from not trusted UID! at android.app.UiAutomationConnection.throwIfCalledByNotTrustedUidLocked(UiAutomationConnection.java:427) at android.app

Build Failed : Gradle with uiautomator android

主宰稳场 提交于 2019-12-24 02:10:55
问题 I had been trying to build my test project jar file using gradle instead of ant with uiautomator android but I am getting BUILD FAILED error. I had referred using gradle with uiautomator android form here - http://wiliamsouza.github.io/#/2013/10/30/android-uiautomator-gradle-build-system I had used the following commands : android create uitest-project -n ProjectName -t 46 -p D:\Android_Workspace\Smriti\ProjectName set ANDROID_HOME=D:\Android Development\android-sdk cd D:\Android_Workspace

UiAutomator bug while inspecting WebView elements

﹥>﹥吖頭↗ 提交于 2019-12-24 00:53:44
问题 I have recently started automation testing in android and was using UiAutomator tool for inspecting UI elements. Surprisingly, I came across two different responses for Webview elements for the same screen and same device [Genymotion MotoX 4.4.4]. Attached are the screenshots for the same. We all know that appium has an issue with inspecting webview elements who do not carry "setWebContentsDebuggingEnabled" to true. Is this a bug in UiAutomator? 回答1: We all know that appium has an issue with

Running UiAutomatorTestcase in AndroidJunit Test Project

旧街凉风 提交于 2019-12-23 18:43:56
问题 I'm actually trying to implement a simple test suite within an AndroidJunit Test project which uses the following class UiObject UiSelector UiAutomatorTestcase to click and open the Messaging application on the Android Device and run it as AndroidJunit Test in Eclipse. While running the code I'm get the following exception java.lang.RuntimeException: Stub! I don't understand where I'm going wrong. Please let me know whether we can run the UiAutomatorTestcase test suite using the AndroidJuint

How to detect headsup notification in uiautomator?

空扰寡人 提交于 2019-12-23 10:07:30
问题 I am working with Nexus 5 and Cyanogen One plus devices with Lollipop android OS. I am trying to test various notifications of certain app. I was successfully able to test tray notification and lock screen notification with UiAutomator but I am not able to have any success with headsup notification. I tried following code but it failed to detect it. public void test_HeadsupTitle() throws InterruptedException, UiObjectNotFoundException, IOException { //some code to bring up headsup

am start -a ACTIVITY from uiautomator code

大兔子大兔子 提交于 2019-12-23 07:00:19
问题 I am trying to launch Settings app from am start -a ACTIVITY from uiautomator code, in this way: am start -n com.android.settings/.Settings But the problem is, the settings activity in one samsung device is /.Settings & in another device is /.SettingsTabActivity. So, how can write the code that should launch Settings app in both the phones? (means how to handle both activities /.Settings & /.SettingsTabActivity) 回答1: Get the device name from getprop ro.build.product and store to a string

android uiautomator runtest error didn't find class

眉间皱痕 提交于 2019-12-22 07:39:09
问题 recent i tryied getting started with android uiautomation testing. The tutorial from the developer site I've worked through a few times and after having some problems and solving them now I have got a bigger issue. I created a project, imported the two jar files and builded a java testcase scenario (the one from the tutorial.) after that I created an uitest projekt with shell command line. updated the build.xml created a jar file and pushed it onto my device. As far as good everything worked