I ran into the same issue, the example is a little stale.  Just add debug 
System.out.println in a few spots to find where the code is broken, then 
restructure the steps to suit your test. In my case, I commented out the 
appsTab lines to get it running.  Good Luck!

On Wednesday, January 15, 2014 9:37:28 PM UTC-6, Vivek Nyayapathi wrote:
>
> If you are using the same code as mentioned in the sample website and it 
> is not running there could be two reasons
>
> a) you are using the setashorizontallist() tag which i believe is only for 
> api-16
> b) you are issuing the wrong target in the -t tag. Instead of numbers I 
> prefer to use -t "android-16" or whichever my target device is.
>  
> Hope this helps.
>
> Cheers!
>
> On Thursday, November 21, 2013 3:21:20 AM UTC-8, Filip Fabijanic wrote:
>>
>> Hi Zhaocong.
>>
>> by the command you're executing i assume that you follow instructions on 
>> this link:
>> http://developer.android.com/tools/testing/testing_ui.html
>>
>> i did every step along the way, everfthing went smooth and when i ran the 
>> test case i got this output:
>>
>> INSTRUMENTATION_STATUS: current=1
>> INSTRUMENTATION_STATUS: id=UiAutomatorTestRunner
>> INSTRUMENTATION_STATUS: class=com.uia.example.my.LaunchSettings
>> INSTRUMENTATION_STATUS: stream=
>> com.uia.example.my.LaunchSettings:
>> INSTRUMENTATION_STATUS: numtests=1
>> INSTRUMENTATION_STATUS: test=testDemo
>> INSTRUMENTATION_STATUS_CODE: 1
>> INSTRUMENTATION_STATUS: current=1
>> INSTRUMENTATION_STATUS: id=UiAutomatorTestRunner
>> INSTRUMENTATION_STATUS: class=com.uia.example.my.LaunchSettings
>> INSTRUMENTATION_STATUS: stream=
>>
>> Error in testDemo:
>> com.android.uiautomator.core.UiObjectNotFoundException: 
>> UiSelector[DESCRIPTION=Apps]
>> at 
>> com.android.uiautomator.core.UiObject.clickAndWaitForNewWindow(UiObject.java:417)
>> at 
>> com.android.uiautomator.core.UiObject.clickAndWaitForNewWindow(UiObject.java:395)
>> at com.uia.example.my.LaunchSettings.testDemo(LaunchSettings.java:27)
>> at java.lang.reflect.Method.invokeNative(Native Method)
>> at 
>> com.android.uiautomator.testrunner.UiAutomatorTestRunner.start(UiAutomatorTestRunner.java:160)
>> at 
>> com.android.uiautomator.testrunner.UiAutomatorTestRunner.run(UiAutomatorTestRunner.java:96)
>> at 
>> com.android.commands.uiautomator.RunTestCommand.run(RunTestCommand.java:91)
>> 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=com.android.uiautomator.core.UiObjectNotFoundException: 
>> UiSelector[DESCRIPTION=Apps]
>> at 
>> com.android.uiautomator.core.UiObject.clickAndWaitForNewWindow(UiObject.java:417)
>> at 
>> com.android.uiautomator.core.UiObject.clickAndWaitForNewWindow(UiObject.java:395)
>> at com.uia.example.my.LaunchSettings.testDemo(LaunchSettings.java:27)
>> at java.lang.reflect.Method.invokeNative(Native Method)
>> at 
>> com.android.uiautomator.testrunner.UiAutomatorTestRunner.start(UiAutomatorTestRunner.java:160)
>> at 
>> com.android.uiautomator.testrunner.UiAutomatorTestRunner.run(UiAutomatorTestRunner.java:96)
>> at 
>> com.android.commands.uiautomator.RunTestCommand.run(RunTestCommand.java:91)
>> 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=testDemo
>> INSTRUMENTATION_STATUS_CODE: -1
>> INSTRUMENTATION_STATUS: stream=
>> Test results for WatcherResultPrinter=.E
>>
>> Time: 13.3
>> FAILURES!!!
>>
>> Tests run: 1,  Failures: 0,  Errors: 1
>>
>> INSTRUMENTATION_STATUS_CODE: -1
>>
>> was it the same thing 4 u?
>> how you solved the problem?
>>
>> i hoped that yoir experience on this subject could help :-)
>>
>> On Monday, July 8, 2013 5:39:12 PM UTC+2, Zhaocong Wu wrote:
>>>
>>> How can i debug uiautomator testcases in Eclipse? I have already added 
>>> '-e debug true' option to call uiautomator:
>>> >adb shell uiautomator runtest LaunchSettings.jar -c 
>>> >com.uia.example.my.LaunchSettings 
>>> -e debug true
>>>
>>> After executed, it outputs:
>>>   Sending WAIT chunk
>>>
>>> And the Devices view in Eclipse shows:
>>>
>>> <https://lh5.googleusercontent.com/-kaDGsaXDtyw/Udrcy5wXnAI/AAAAAAAACiM/SFvqIZhLxB0/s1600/QQ_20130708195933.png>
>>>
>>> Could you tell me the solution to fix? Thank you :)
>>>
>>

-- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to