android-uiautomator

UiAutomator changing variables

五迷三道 提交于 2019-11-29 18:13:05
I've got a test case that accesses the browser and does some stuff with it. But I need to programmatically change what the inputs are for some of the text boxes. I have 8 strings and a boolean value that the test needs the run properly. The problem is, is that you have to run the test case through ant and the build process before you can actually run it. I'd love to be able to build this, put it on the device and then somehow pass the data to the device when I call it. But I don't know if that is possible. The only option I can think of at the moment, is to write a quick java program to write

can we use UIAutomator in android applications?

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-29 11:11:14
I want to know can we use UIAutomator in our applications ? I want write an app that open another application , Write some Text in that application EditText and then press some buttons(like open hangout and write a text on it and send the message ). Can u Suggest me how can i do this ? i have search the net and i could only find out i can test my UI with UIAutomator , but i don't know can i use it to write a android application ( not jar file ) and run it on my android device to do this. This isn't possible. UiAutomator 2.0 relies on Instrumentation which is only available when you run your

Unable to open UIAutomatorviewer on Mac High Sierra

半腔热情 提交于 2019-11-29 08:46:50
We have brand new MacBooks with High Sierra (10.13.6). Other system info: JAVA Version: java version "11.0.1" 2018-10-16 LTS Java(TM) SE Runtime Environment 18.9 (build 11.0.1+13-LTS) JAVA_HOME: /Library/Java/JavaVirtualMachines/jdk-11.0.1.jdk/Contents/Home When tried to open Android UIAutomatorViwer we're getting following error: /Library/Android/sdk/tools/bin/uiautomatorviewer ; exit; /Library/Android/sdk/tools/lib is not supported. Use -classpath instead. Error: Could not create the Java Virtual Machine. Error: A fatal exception has occurred. Program will exit. logout Saving session... ..

Android - Independent Fragment UI testing tool

做~自己de王妃 提交于 2019-11-28 17:37:21
问题 I've been looking for a way to test the UI of my Fragments separately (ie, independently from other fragments and activities) but I can't find a way to do it. In particular, let's say I have Fragment A, Fragment B and Fragment C. The only way (app-wise) to go to Fragment C is by passing through Fragment A and Fragment B first. I am looking for a way to test Fragment C directly (potentially by mocking its dependencies, if any exists), without having to pass through Fragment A and B. Tools I

Cannot resolve symbol 'AndroidJUnit4'

夙愿已清 提交于 2019-11-28 16:16:13
Obviously I need the correct import statment to solve this problem. According to the docs for AndroidJUnit4 , this should be import android.support.test.runner.AndroidJUnit4; When I do that, Android Studio highlights runner in red and complains "Cannot resolve symbol 'runner'". Background I got to this point by following the tutorials on the Android Developer site for setting up tests using UI Automator . The first problem I encountered was that com.android.support:support-v4:22.2.0 and com.android.support.test:runner:0.2 depend on different versions of com.android.support:support-annotations

Error obtaining UI hierarchy Error while obtaining UI hierarchy XML file: com.android.ddmlib.SyncException: Remote object doesn't exist

∥☆過路亽.° 提交于 2019-11-28 10:05:17
I am testing my app with adb, but i get this error when i execute "dump view hierarchy for uiautomator": Error obtaining UI hierarchy Error while obtaining UI hierarchy XML file: com.android.ddmlib.SyncException: Remote object doesn't exist! My adb version is 1.0.36 and my android version is 6.0.1. This error comes launched only when in the interface there is a dynamic element that is in motion. thank you in advance. The best way is to kill the adb server and start it again. sudo adb kill-server sudo adb start-server This will do the trick. Currently your UI needs to be idle (as in no

Set different minSdkVersion for testAndroid than for main app

时光毁灭记忆、已成空白 提交于 2019-11-28 06:11:44
Is it possible to set a different minSdkVersion for tests than for the app itself? I ask because I want to use the new Test Support Library and UI Automator for testing. However, this is only available on API 18+. At the same time, I still want to support older versions of Android, albeit not as thoroughly tested. What do I need to add to my build.gradle file in order to do this? To clarify, I am using Android Studio and the "new" Gradle-based project structure. I got this from the new testing template from Google. Create a new AndroidManifest.xml file in your test or androidTest folder. <?xml

Android Testing: UIAutomator vs Espresso

假如想象 提交于 2019-11-28 04:49:37
I was seeking for test frameworks for Android UI automation and I stumbled upon UI Automator and Espresso and this is the part I am confused about - Both are maintained by Google Both are used for functional UI testing Both are Android only frameworks So my questions/doubts here are - What is the major difference between UI Automator and Espresso ? Will the source code have to be modified to integrate any of these frameworks? Does one framework hold any advantage over the other? If yes, then which framework is the most suitable for UI automation of an Android app? UIAutomator – is powerful and

Unable to open UIAutomatorviewer on Mac High Sierra

核能气质少年 提交于 2019-11-28 02:04:04
问题 We have brand new MacBooks with High Sierra (10.13.6). Other system info: JAVA Version: java version "11.0.1" 2018-10-16 LTS Java(TM) SE Runtime Environment 18.9 (build 11.0.1+13-LTS) JAVA_HOME: /Library/Java/JavaVirtualMachines/jdk-11.0.1.jdk/Contents/Home When tried to open Android UIAutomatorViwer we're getting following error: /Library/Android/sdk/tools/bin/uiautomatorviewer ; exit; /Library/Android/sdk/tools/lib is not supported. Use -classpath instead. Error: Could not create the Java

Error in using UIAutomatorviewer for testing Android app in Appium

丶灬走出姿态 提交于 2019-11-27 22:08:30
I have to automate an Android application, I am doing the same through Appium. The problem I am facing is after launching the Appium server, the app is getting installed in the emulator 4.4.2 and to inspect the element I am using UIAutomatorviewer which comes default with SDK. But while inspecting the element of the app, I am getting the error![enter image description here][1] Error obtaining UI hierarchy Reason:Error while obtaining UI hierarchy XML file.com.android.ddmlb.SynchException.Remote object doesn't exist. I tried to find the solution so that I can inspect the element so that I can