tag:blogger.com,1999:blog-25456655.post8647009049162412137..comments2024-03-23T07:01:55.848-04:00Comments on Diego Torres Milano's blog: AndroidViewClient: dump.py explainedDiego Torres Milanohttp://www.blogger.com/profile/12030778501784140349noreply@blogger.comBlogger5125tag:blogger.com,1999:blog-25456655.post-47298151558672637752013-04-20T15:31:26.281-04:002013-04-20T15:31:26.281-04:00@Srini,
What's the use case?
By the time you a...@Srini,<br />What's the use case?<br />By the time you are running your script, with the content restored from a previous run, what's on the device may not be the same and methods like touch() may give wrong results.<br />Anyway, I guess what you want to do is something similar to mocks.py in tests (take a look at tests/com/dtmilano/android/mocks.py)Diego Torres Milanohttps://www.blogger.com/profile/12030778501784140349noreply@blogger.comtag:blogger.com,1999:blog-25456655.post-893766861356015622013-04-19T13:36:31.876-04:002013-04-19T13:36:31.876-04:00That is what I am doing and then I parse for whate...That is what I am doing and then I parse for whatever I need from the text file. Instead I thought I can redirect in the following way but didn't work(save the existing stdout and set the stdout to my outfile and then restore original stdout). I thought this will take care of the traverse(.... stream=sys.stdout)call in ViewClient but didn't.<br />old_stdout = sys.stdout<br />sys.stdout = outf<br />ViewClient(*ViewClient.connectToDeviceOrExit(**kwargs1), **kwargs2).traverse(transform=transform)<br />sys.stdout = old_stdoutAnonymoushttps://www.blogger.com/profile/16574658977635274702noreply@blogger.comtag:blogger.com,1999:blog-25456655.post-20812864429923092402013-04-19T02:05:07.832-04:002013-04-19T02:05:07.832-04:00@Srini,
Simply redirect the output:
$ dump.py ...@Srini,<br />Simply redirect the output:<br /><br /> $ dump.py > mydump.txt<br />Diego Torres Milanohttps://www.blogger.com/profile/12030778501784140349noreply@blogger.comtag:blogger.com,1999:blog-25456655.post-68848233417351076322013-04-18T19:28:25.708-04:002013-04-18T19:28:25.708-04:00Hi Diego,
AndroidViewClient is very interesting an...Hi Diego,<br />AndroidViewClient is very interesting and I am wondering how to redirect the view details to a text file.<br /><br />BR<br />SriniAnonymoushttps://www.blogger.com/profile/16574658977635274702noreply@blogger.comtag:blogger.com,1999:blog-25456655.post-83202919245403624502013-04-02T09:47:48.877-04:002013-04-02T09:47:48.877-04:00Hi Diego,
First I would like to thank you for all...Hi Diego,<br /><br />First I would like to thank you for all your work in helping the Android testing community and for creating this great tool that is AndroidViewClient.<br /><br />I am trying to do a simple test in which I click on an album from the Gallery and select a picture. I have tried using your script "gallery-select-album.py" but it could not find nor click on any album.<br /><br />So I ran "dump.py -Vc", and got the following:<br /><br />android.widget.FrameLayout id/no_id/1 (360, 592)<br /> android.widget.FrameLayout id/no_id/2 (360, 592)<br /> android.widget.FrameLayout id/no_id/3 (360, 617)<br /> android.widget.RelativeLayout id/no_id/4 (360, 617)<br /> android.view.View id/no_id/5 (360, 617)<br /> android.widget.LinearLayout id/no_id/6 (360, 98)<br /> android.widget.FrameLayout id/no_id/7 (360, 98)<br /> android.view.View id/no_id/8 (360, 98)<br /> android.widget.LinearLayout id/no_id/9 (57, 98)<br /> android.widget.FrameLayout id/no_id/10 (57, 98)<br /> android.widget.ImageView id/no_id/11 (57, 98)<br /> android.widget.LinearLayout id/no_id/12 (232, 98)<br /> android.widget.Spinner id/no_id/13 (232, 98)<br /> android.widget.TextView id/no_id/14 Albums (202, 98)<br /> android.widget.LinearLayout id/no_id/15 (608, 98)<br /> android.widget.TextView id/no_id/16 (552, 98)<br /> android.widget.ImageButton id/no_id/17 (664, 98)<br /><br />My device is a Galaxy Nexus, with JB. I can't seem to find which one of those IDs corresponds to an album so I can touch it. Could you please help me out on this?<br /><br />Thanks,<br />MelissaAnonymoushttps://www.blogger.com/profile/10079070087677889541noreply@blogger.com