Hi,
I've been playing around with uiautomator for the past few days and it seems like it will be very useful. Going forward, I'd like to run my tests on the emulator instead of real devices. However I haven't been able to get this working yet.
My first attempt was on an x86 image of Android 4.1.2 and it yields the following result:
$ adb shell uiautomator runtest LearnUITesting.jar -c SchoolListSearchTest
[: not found
[: not found
[: not found
uiautomator: 70: Syntax error: Bad substitution
I couldn't figure out what's triggering this error. I'm pretty sure my test setup is fine because uiautomator runs flawlessly on my Galaxy Nexus.
Next I attempted to test using the Google APIs ARM image for 4.2. This time the test starts but then I get an immediate Exception when setting up my UiScrollable:
$ adb shell uiautomator runtest LearnUITesting.jar -c SchoolListSearchTest
INSTRUMENTATION_STATUS: current=1
INSTRUMENTATION_STATUS: id=UiAutomatorTestRunner
INSTRUMENTATION_STATUS: class=SchoolListSearchTest
INSTRUMENTATION_STATUS: stream=
SchoolListSearchTest:
INSTRUMENTATION_STATUS: numtests=1
INSTRUMENTATION_STATUS: test=testSearch
INSTRUMENTATION_STATUS_CODE: 1
INSTRUMENTATION_STATUS: current=1
INSTRUMENTATION_STATUS: id=UiAutomatorTestRunner
INSTRUMENTATION_STATUS: class=SchoolListSearchTest
INSTRUMENTATION_STATUS: stream=
Error in testSearch:
java.lang.NoSuchMethodError: com.android.uiautomator.core.UiScrollable.setAsHorizontalList
at SchoolListSearchTest.testSearch(SchoolListSearchTest.java:21)
at java.lang.reflect.Method.invokeNative(Native Method)
at com.android.uiautomator.testrunner.UiAutomatorTestRunner.start(UiAutomatorTestRunner.java:124)
at com.android.uiautomator.testrunner.UiAutomatorTestRunner.run(UiAutomatorTestRunner.java:85)
at com.android.commands.uiautomator.RunTestCommand.run(RunTestCommand.java:76)
at com.android.commands.uiautomator.Launcher.main(Launcher.java:83)
at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:235)
at dalvik.system.NativeStart.main(Native Method)
INSTRUMENTATION_STATUS: numtests=1
INSTRUMENTATION_STATUS: stack=java.lang.NoSuchMethodError: com.android.uiautomator.core.UiScrollable.setAsHorizontalList
at SchoolListSearchTest.testSearch(SchoolListSearchTest.java:21)
at java.lang.reflect.Method.invokeNative(Native Method)
at com.android.uiautomator.testrunner.UiAutomatorTestRunner.start(UiAutomatorTestRunner.java:124)
at com.android.uiautomator.testrunner.UiAutomatorTestRunner.run(UiAutomatorTestRunner.java:85)
at com.android.commands.uiautomator.RunTestCommand.run(RunTestCommand.java:76)
at com.android.commands.uiautomator.Launcher.main(Launcher.java:83)
at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:235)
at dalvik.system.NativeStart.main(Native Method)
INSTRUMENTATION_STATUS: test=testSearch
INSTRUMENTATION_STATUS_CODE: -1
INSTRUMENTATION_STATUS: stream=
Test results for UiAutomatorTestRunner=.E
Time: 4.95
FAILURES!!!
Tests run: 1, Failures: 0, Errors: 1
INSTRUMENTATION_STATUS_CODE: -1
Any ideas about what could be going on here?
Walter
I am facing exactly the same problem as you. Didn't you figure out any solution yet? I am using Galaxy S III upgraded to Jelly Bean and emualtor, and AndroVM, all have the same problem.
On Tuesday, January 8, 2013 2:39:05 AM UTC-8, Kshitij Aggarwal wrote:Actually im facing this problem on both device and emulator. I was able to run it on emulator initially. But when I installed some apps to make the app list span more then one page, it started giving me the error.
I have faced this issue when I was working with Uiautomator. I found that if you are working with API 16 device add the jar from "\android-sdk\platforms\android-16" and Build with the target 8.
It will work for me.
Thanks,
Kinjal Patel
You received this message because you are subscribed to the Google Groups "adt-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to adt-dev+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.