开发者

Testing android Activities/Views with automatic screenshot taking?

We are writing Android app that is supposed to run on wide range of resolutions and screen sizes and I would like to do fast last minute verifications that nobody introduced problems in the GUI. IMHO the best way would be to just take screenshots of all Views in different resolutions/emulators and then just check them manually.

So the work flow I imagine would be:

  1. Coding/Changing graphics
  2. Commit to source code repository
  3. La开发者_StackOverflowunching tests/tools/special tasks in Hudson/Jenkins (we are using latter)
  4. Getting screenshots from emulators that are started in different resolutions.

Is there any tool to do that? We used to do that for web applications using Selenium but I'm looking for similar solution in Android world.


You can use this library https://github.com/rtyley/android-screenshot-lib#readme with the android maven plug in to build your project. If you included it in your project you can simpliy call the poseforscreenshot() Method to generate a screenshot of the actual view. You can find them in a folder named screenshots. There you also can find a .gif file which shows you the "animated" screens.

If you want to do it automatic in several configurations, screensizes etc, then you could try to configure a emulator matrix in Jenkins with the Android-Emulator Plugin. See this link for more information https://wiki.jenkins-ci.org/display/JENKINS/Android+Emulator+Plugin

I hope it helps.


so basically you want to take a screenshot of whatever is there on your phone and then check it whether it is giving you the expected results or not..is that what you want to do?? Unfortunately you cant take screenshots directly on an Android phone, there are ways to do that. But let me know if I am getting you correctly.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜