0

I am seeing issue that ids reported by emulator and device are different. I do have different android versions on them.

dump shows at pastebin dump outputs for emulator and device and the screen shots are here emulator http://imagebin.org/271953 http://imagebin.org/271953 and device http://imagebin.org/271954 http://imagebin.org/271954

Note that emulator has android 4.2.2 api 17 while device has android 4.2.1. I though feel both are API 17 should they should be considered same. I did not spot 4.2.1 platform in android sdk manager.

Also -F option to dump does not work on non-developer device (not rooted). How to then test in development devices is there some setting ?

When I did the dump -ViF on cyanogenmod rooted device I was got below results. I also checked using

 (eval $(adb shell getprop | dos2unix | egrep '\[ro\.secure]|\[ro\.debuggable]' | sed 's/\./_/g; s/]: /=/g; s/[][]//g'); [[ 1 == $ro_secure && 0 == $ro_debuggable ]] && echo "System is secure: AVC won't work" || echo "System is not secure: AVC will work")

System is not secure: AVC will work

mitenm@mitendebian:~$ dump -ViF

Connecting to a device with serialno=.* with a timeout of 60 secs...

Connected to device with serialno=.*

Actual device serialno=0009cdf44f784f

Traceback (most recent call last):

  File "//home/mitenm/testing/AndroidViewClient-master/AndroidViewClient/tools/dump", line 134, in <module>

    vc = ViewClient(*ViewClient.connectToDeviceOrExit(**kwargs1), **kwargs2)
  File "/home/mitenm/testing/AndroidViewClient-

master/AndroidViewClient/src/com/dtmilano/android/viewclient.py", line 1219, in __init__
    'tcp:%d' % self.remotePort])

  File "/usr/local/lib/python2.7/subprocess.py", line 537, in check_call
    retcode = call(*popenargs, **kwargs)

  File "/usr/local/lib/python2.7/subprocess.py", line 524, in call
    return Popen(*popenargs, **kwargs).wait()

  File "/usr/local/lib/python2.7/subprocess.py", line 711, in __init__
    errread, errwrite)

  File "/usr/local/lib/python2.7/subprocess.py", line 1308, in _execute_child
    raise child_exception

OSError: [Errno 2] No such file or directory

I have ANDROID_VIEW_CLIENT_HOME env var set.

I was trying -F option so I could get R.id which I could then use in my test program. can one point me an example of it. It seems that -F will work well only with emulator so better live with no_id rather than R.id.

Also if I want to test android service (not Activities) then can I still use androidviewclient ? if so please provide link to example.

can we also do screen capture and write to files like in monkeyrunner ?

Regards,

Miten.

Miten
  • 356
  • 7
  • 23

1 Answers1

0

The dumps posted seems to be from completely different screens. For example, the first one includes a label for Forgot your username or password? while this is not in the second one but You must log out before proceeding! is only in the latter.

Unfortunately, the links to your screenshots are broken, so further help is not possible.

If this is your application, you can set content descriptions for your Views and be free from the ID's. Use --content-description in your dump command line.

EDIT: Regarding screenshots using AndroidViewClient and the improvements over monkeyrunner see http://dtmilano.blogspot.ca/2013/09/androidviewclientculebra-takesnapshot.html

EDIT: Unique IDs are assigned on the fly as Views are discovered, so if two applications or devices differ just in one View, all the remaining unique IDs assigned will differ too.

Diego Torres Milano
  • 65,697
  • 9
  • 111
  • 134
  • sorry about that. The dumps are from different ui. Actually the login screen has second screen which probably I pulled from emulator. I will see if I can get back to login screen on emulator and provide dump. Thanks for tip on content-description. I guess I need to set it on android code but for 3rd party code I will not have access to source ? – Miten Sep 30 '13 at 12:58
  • I have updated post to show emulator output which shows that its different from device. I have also give image urls. – Miten Oct 01 '13 at 11:20
  • I am unable to reproduce the error with different application so its quite possible that the versions of code running for login are different though am not 100% sure. – Miten Oct 03 '13 at 17:20