Android_android UI automated testing tool robotium vs nativedriver vs calabash

Source: Internet
Author: User

It has been nearly a year since the previous comparison of robotium and nativedriver tools (see http://kongqingyun123.blog.163.com/blog/static/637728352011614111010446/ for the last time), and a year has certainly changed a lot for an open-source tool. At the same time, many of the original views on the tool will be somewhat different. At the beginning, nativedriver was chosen for automated testing on some mobile phones, but some problems were also found in the subsequent use process, currently, we are mainly using robotium to write some test cases.
Robotium:
Http://code.google.com/p/robotium/
The latest version 3.3 has been released, and the robotium community is still very active. Many people may ask questions and help you solve the problems. Can join groups, http://groups.google.com/group/robotium-developers
Let's briefly explain the reasons for using robotium later.
1. Slide operations are supported. sliding screens can only be used in many areas of the test project. robotium supports slide operations, but nativedriver does not.
2. robotium supports obtaining toast, but nativedriver does not.
3. Concerning the problem that robotium needs to re-sign the application, this is actually not a problem. It is easy to implement and can be fully automated, in Windows, the bat script that is automatically re-signed for the application can refer to the http://kongqingyun123.blog.163.com/blog/static/63772835201243143159515/
4. Many of the APIS mentioned above use index indexes. In fact, robotium also provides the R. the ID in the Java file to get the element, but the premise is that you can get the R. java file, we test our own company's applications, so that we can easily keep a copy of the R. java File
View button = solo. getview (R. id. button); solo. clickonview (button);, as long as the development does not change the name of the Space ID, each time you only need to use the latest R. you can overwrite the Java file to facilitate subsequent test case maintenance.
Of course, you will find some difficult points during the use of each tool:
For the specific practice method below, I will write an article later to introduce some of our robotium-based use cases. I wrote a framework on the PC side to solve these problems, at the same time, you can use simple configurations to automatically run automatic tests on Simulators of different versions.
On the PC end framework can be achieved by reference: http://kongqingyun123.blog.163.com/blog/static/63772835201262534056673/
1. robotium sometimes crash when running test cases, directly causing the test to stop, and your test results cannot be collected.
My personal solution to this problem is to send the ADB shell am instrument command through cmd when running the test case, and only one test case is executed at a time, then, you can determine whether it is crash by obtaining the CMD return value. If it is crash, re-run the case.
2. Unstable Test Cases
Sometimes you have finished writing the use case, but sometimes it may fail to run on the simulator, the current solution is to continue re-run if it fails to be obtained according to the return value of the test result. The re-run is defined three times. (An open-source Android-JUnit-report tool is used here)
3. The webview control is not supported. (Not supported by robotium, supported by calabash)

Nativedriver:
Http://code.google.com/p/nativedriver/
See here http://kongqingyun123.blog.163.com/blog/static/637728352011614111010446/
Nativedriver was developed by Google's Japanese team, but the team has already been working on other projects, so nativedriver is basically not updated, and the Community activity is also low. Some bugs in nativedriver are not fixed yet.

Calabash:
Https://github.com/calabash
Calabash-android is implemented by robotium + cucumber, and the bottom layer is still robotium. It has added support for webview.
Soon after the open-source tool was launched, the community was very active. If you have any questions, the open-source author will actively help you solve the problem.

The specific effect of this tool has not been put into practice yet. However, it will be of interest to support Android and iOS, and to use cucumber to write test cases. In addition, it also supports webview controls.

Reprinted from: http://www.360doc.com/content/13/0730/22/7528063_303675777.shtml

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.