AndroidViewClient icon indicating copy to clipboard operation
AndroidViewClient copied to clipboard

MonkeyRunner and androidviewclient “dump-all-windows-lib.py” example is not working

Open salamatiehsan opened this issue 12 years ago • 3 comments

I'm running dump-all-windows-lib.py example, but it keeps showing this error:

windows = vc.list() File "/Users/ehsan/Desktop/Android/adt-bundle-mac-x86_64-20130514/sdk/tools/androidviewclient-2.3.24.jar/com/dtmilano/android/viewclient$py.class", line 1864, in list Exception: Not implemented yet: listing windows with UiAutomator I can run other examples but I don't know what is the problem. and this is how I run the example:

monkeyrunner -plugin androidviewclient-2.3.24.jar dump-all-windows-lib.py Thanks in advance...

salamatiehsan avatar Jun 30 '13 15:06 salamatiehsan

Well, it's running and telling you that list has not been implemented yet for UiAutomator back-end, mainly because UiAutomator has no list windows.

There are at least two workarounds:

  • forcing the use of ViewServer (see dump -F|--force-view-server-use)
  • use dumpsys window windows to obtain the list of windows

Furthermore, you may not need the list of all windows in the system to dump all Views in your application, just use -1 as the window ID.

dtmilano avatar Jul 01 '13 05:07 dtmilano

Thanks for the answer, I want to have the whole GUI tree of my application not just the current activity which is showing in emulator. Can you help me with that with a sample code or something. I will really appreciate that. I am totally new to monkeyrunner and androidviewclient:)

salamatiehsan avatar Jul 01 '13 13:07 salamatiehsan

dump will show what's on the screen, so you may have to start your activities and get the dump then.

On Mon, Jul 1, 2013 at 9:39 AM, salamatiehsan [email protected]:

Thanks for the answer, I want to have the whole GUI tree of my application not just the current activity which is showing in emulator. Can you help me with that with a sample code or something. I will really appreciate that. I am totally new to monkeyrunner and androidviewclient:)

— Reply to this email directly or view it on GitHubhttps://github.com/dtmilano/AndroidViewClient/issues/34#issuecomment-20282025 .

Have you read my blog ? http://dtmilano.blogspot.com android junit tests ui linux cult thin clients

dtmilano avatar Jul 01 '13 16:07 dtmilano