android-uiautomator

Can't select Test class in Edit Configuration

情到浓时终转凉″ 提交于 2019-12-12 06:59:07
问题 I have created an Espresso/UIAutomator unit test. However, when I try to run it, Android Studio won't recognize it. The button to select TestLogin.java is greyed out. I'm using Android Studio 2.0 preview 5. package com.greenrobot.yesorno.test.TestLogin import android.support.test.rule.ActivityTestRule; import android.support.test.runner.AndroidJUnit4; import android.test.suitebuilder.annotation.LargeTest; import org.junit.Rule; import org.junit.Test; import org.junit1.runner.RunWith; import

UI Automator Viewer finds elements inconsisently

大兔子大兔子 提交于 2019-12-12 05:19:10
问题 I have a weird issue while working with the UI Automator Viewer. The problem is that I get inconsistent result when doing "Device Screenshot" (uiautomator dump). So in some cases, I get all the elements(nodes) but in some cases I get only some of them, generally the basic whole page view without the textviews and buttons on it. To make things even more challenging, it looks like it happens absolutely random. So I can click on screenshot/dump button multiple times in a row and get different

working with UIautomator 2.0 and Android Studio 2.x

孤者浪人 提交于 2019-12-12 02:43:04
问题 I was working with uiautomator 1.0.1 using eclispe and generating jar files and using in my setup. Can anyone point to appropriate source where I can get step by step procedure for switching to Uiautomator 2.0 with Android Studio. 回答1: To use the Android Testing Support Library in your Gradle project, add these dependencies in your build.gradle file: dependencies { androidTestCompile 'com.android.support.test:runner:0.4' // Set this dependency to use JUnit 4 rules androidTestCompile 'com

Cannot connect to Sql Server via Android Test

≯℡__Kan透↙ 提交于 2019-12-12 00:50:48
问题 I have created simple android tests with UiAutomator. In these tests I want to confirm that some data were added in the database. In my pc I can connect to the database, but in the virtual android device I get the following error: java.lang.ClassNotFoundException: Didn't find class "net.sourceforge.jtds.jdbc.Driver" on path: /system/framework/android.test.runner.jar:/system/framework/uiautomator.jar::/data/local/tmp/Tests.jar when loading the driver: Class.forName("net.sourceforge.jtds.jdbc

ImportError: cannot import name 'Device' , when using uiautomator Python 3

元气小坏坏 提交于 2019-12-11 17:12:44
问题 im trying to test an app using uiautomator module of python. but im getting the same error . Im using python3. does it work only with python 2.7 or what ?? i'm unable to resolve the issue.. when i open python interpreter and run the commands: from uiautomator import device as d d.info() the process gets struck and doesn't do anything.. but when i run the script, it gives out this Error message: "from uiautomator import Device" and "ImportError: cannot import name 'Device'" please help.. 来源:

Are UiAutomator and AccessibilityServices not compatible?

早过忘川 提交于 2019-12-11 12:38:55
问题 I have an AccessibilityService (AS) running to programatically get information about what's currently displayed on the screen. Now I want to set some UiAutomator test cases. However, if I have the AS running the UiAutomator gives the following error: INSTRUMENTATION_RESULT: shortMsg=java.lang.SecurityException INSTRUMENTATION_RESULT: longMsg=Permission Denial: getIntentSender() from pid=9700, uid=2000, (need uid=1000) is not allowed to send as package android I've searched the web and I've

How to send text with space in Android UIAutomator -e command line parameter

吃可爱长大的小学妹 提交于 2019-12-11 11:15:54
问题 I want to know how to send text with space in Android UIAutomator -e option (name-value pair) For Ex: adb shell uiautomator runtest LaunchSettings.jar -c com.uia.example.my.LaunchSettings I want to send like adb shell uiautomator runtest LaunchSettings.jar -c com.uia.example.my.LaunchSettings -e appName Temple Run But getting error message like: Unsupported standalone parameter. tried like "Temple Run" or 'Temple Run' but no use. Please suggest 回答1: String defaultAppName = "My super App";

android ant uibuild.xml:198: null returned: 1

爷,独闯天下 提交于 2019-12-11 10:48:12
问题 I am new to ant and Android uiautomator. When using ant to build my testing program I get: -dex: [dex] input: c:\Eclipse\workspace\Android\bin\classes [dex] Converting compiled files and external libraries into c:\Eclipse\wor kspace\Android\bin\classes.dex... [dx] no classfiles specified BUILD FAILED C:\Android\sdk\tools\ant\uibuild.xml:198: null returned: 1 This is on the sample test code at: http://developer.android.com/tools/testing/testing_ui.html#sample The full output from running the

real device Vs emulator : uiautomator does not show resource-id for the app

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-11 10:47:48
问题 I need the element id for my appium - android automation testing. When I use real device with UIAUTOMATOR, I get the resource - id to interact with the element like : driver.findElementById("com.xyz.android:id/GSG"); However, when I use an emulator with my UIAUTOMATOR , there is no resource - id for the same elements and my script is also not able to interact with the element based on my real device id...any help as to how to fix this or why it behaves like this? 回答1: I found the answer using

Parameters to uiAutomator test class

浪尽此生 提交于 2019-12-11 10:08:29
问题 I am new to uiAutomator. I tried passing the parameters to method, it run but just ignores anything passed to it. Just wondering whether we can pass any arguments to test class or test method in uiAutomator? 回答1: Reference You can send in parameters via command line: adb shell am insrument -e <NAME> <VALUE> <package/runner> You can access the value using the bundle that is available if you override the onCreatemethod of the InstrumentationTestRunner. public void onCreate(Bundle