android-uiautomator

Writing tests for an android app that logs into Facebook: UIAutomator can't fill in text in Facebook's username field

我的梦境 提交于 2019-12-21 06:26:54
问题 From this question/answer I got the idea to use UIAutomator to test my app that requires logging into Facebook. Writing tests for an Android app that logs into Facebook I tried UiObject2 editText = mDevice.findObject(By.clazz("android.widget.EditText")); editText.setText("test@email.com"); As well as other things but whatever I do I can't get it to fill out the field. I used hierachyviewer tool to see that it was an EditText. It's a webview, though, so I don't know. Is this possible? My full

java.lang.SecurityException: Permission Denial: getIntentSender() when using UiAutomation in a test

浪尽此生 提交于 2019-12-21 03:42:15
问题 Whenever I try to use UiAutomation in any test through getInstrumentation().getUiAutomation() , the process crashes with this exception: java.lang.SecurityException: Permission Denial: getIntentSender() from pid=30334, uid=2000, (need uid=1000) is not allowed to send as package android at android.os.Parcel.readException(Parcel.java:1540) at android.os.Parcel.readException(Parcel.java:1493) at android.app.IUiAutomationConnection$Stub$Proxy.disconnect(IUiAutomationConnection.java:225) at

whats is the difference between UIObject and UIObject2 other than UIAutomator 2.0 version name?

余生长醉 提交于 2019-12-21 01:59:19
问题 I have done some Googling and searched in Android Developer website but I could not able to find a suitable answer. Can anyone help me out for this? thanks in advance. 回答1: Key Differences: What they represent Waiting for views to exist/finding views Scrolling What they represent In my words, UiObject2 is a direct representation of a real view that exists on the screen and allows you to take actions on that view. UiObject is a representation of how to find an element that may be on the screen

can we use UIAutomator in android applications?

[亡魂溺海] 提交于 2019-12-18 06:13:12
问题 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. 回答1:

Error in using UIAutomatorviewer for testing Android app in Appium

限于喜欢 提交于 2019-12-17 16:16:45
问题 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

How to script MO call and browsing on 2 devices from UIAutomator for Android devices

房东的猫 提交于 2019-12-13 21:12:46
问题 I am new to UIAutomator for android devices. I am writing these scripts in eclipse IDE using JAVA. I need one sample script for automating call scenario where i call from one phone and recieve the call from another phone and then i am browsing from first phone. Can we do this from one single script ? 回答1: As Uiautomator scripts run from the device under test, it would not be possible to test call-receive scenario using UIautomator framework. Instead have a look at android MonkeyRunner

UiAutomator 2.0 and Eclipse

戏子无情 提交于 2019-12-13 15:56:42
问题 Is there any way to compile UiAutomator 2.0 with Eclipse and Ant? I have added the android.jar and uitautomator.jar files from Android-23 but to no avail. Eclipse still does not see UiAutomator 2.0 specific methods like UiObject2 . I have also attempted to build a .jar file with Ant in Gradle which generates the required .jar file but only works for UiAutomator 1.0 . I used the method detailed here. I know Android now officially only supports Android Studio+Gradle now but my setup requires

Issue with Long click using instrumentation class in uiautomator for 4.3 android version

假如想象 提交于 2019-12-13 01:56:32
问题 I tried to performing long click on screen using the Motion Event class and instrumentation class. This class seems to work fine for 4.2 and below devices but when I tried to implement the same on the 4.3 devices I'm facing the following exception Could any one please help me out in resolving this problem Thanks in Advance The method which I used to perform long click event is private void longClickOnScreen(float x, float y) { try { long downTime = SystemClock.uptimeMillis(); long eventTime =

Is it possible to slide open/closed a navigation drawer in uiautomator

一世执手 提交于 2019-12-13 01:27:59
问题 Has anyone been able to pull this off. UiScrollable, swipeLeft and swipeRight do not appear to have any affect on it. I am using a Nexus 5 emulator with the latest api. Has anyone been able to pull it off? 回答1: TL;DR : Use the content descriptions set in the ActionBarDrawerToggle constructor When you set up your Navigation Drawer, set an ActionBarDrawerToggle with content descriptions for opening and closing. // Open drawer content description for accessibility private static final String

Is the isChecked() method Deprecated

佐手、 提交于 2019-12-12 14:51:21
问题 Is the isChecked() method Deprecated? I am coding for android UI and using UiAutomator Framework there this mathod is not displayed I am trying to validate one uiobject through isChecked() whether it is clicked or not. from the below link i came to know it is Deprecated and now we should use getValue() . http://www.gwtproject.org/javadoc/latest/com/google/gwt/user/client/ui/CheckBox.html Code: UiObject object = new UiObject(new UiSelector().text("Airplane mode")); if(object!=null) { if(