0

vc.writeImageToFile("C:\image.png") code gives the following error:

File "C:\AndroidViewClientMaster\AndroidViewClient\src\com\dtmilano\android\viewclient.py", line 2309, in writeImageToFile self.device.takeSnapshot().writeToFile(filename, format)

File "C:\Python27\lib\site-packages\PIL\Image.py", line 512, in getattr raise AttributeError(name)

AttributeError: writeToFile

What is wrong?

Prophet
  • 32,350
  • 22
  • 54
  • 79
  • Writing the entire views hierarchy tree to image file failed but it worked for me when I wrote single view image into several sub-folders. Trying to write single view image to root folder C:\ or C:\Users gives another error. I work on Windows 7 OS so I have full permissions to write in all folders I tried to. – Prophet May 04 '14 at 18:52
  • This could give you some extra info: http://dtmilano.blogspot.ca/2014/03/adbclient-under-hood-of.html – Diego Torres Milano May 05 '14 at 18:58
  • Thank you Diego for this article. Currently I have no idea how to use these abilities, I'm on very beginning steps of writing my automation. But maybe in the future I will use this (and this future may come soon). Currently I need an implementation of scrolling the lists and drag & drop views. I see this is not implemented directly in your script but there is a hint I see here: http://stackoverflow.com/questions/22381143/touch-swipe-or-drag-events-emulating-on-android-not-working. I hope this will lead me to the implementation. – Prophet May 05 '14 at 20:10
  • But...you're right! Is's actaully a bug :-O – Diego Torres Milano May 05 '14 at 21:36

1 Answers1

0
vc.writeImageToFile("C:\image.png")

should work correctly on AndroidViewClient >= 5.4.7

Diego Torres Milano
  • 65,697
  • 9
  • 111
  • 134
  • The latest version I got from you only 12 days ago is 5.4.3... Can you please provide a link there I can always download the latest version? On https://github.com/dtmilano/AndroidViewClient I can't find it. Additionally I'd like to receive the updates when you release a new builds with some list of new / fixed features in this build if it is possible. Thanks! – Prophet May 06 '14 at 07:26
  • 12 days it's a lot of time for this ;-) All the development happen at [github](https://github.com/dtmilano/AndroidViewClient), so it's always the latest version. And I usually update [Python PIP](https://pypi.python.org/pypi/androidviewclient/5.4.7) after major changes happen in github, so updating from PIP would keep you up-to-date. – Diego Torres Milano May 06 '14 at 14:35