Robotframework (1) Keyword driven test framework

Source: Internet
Author: User

Used to think about writing test framework, the results in the actual put into use after the total found that there are many drawbacks, either difficult to maintain, or is not suitable for the popularization, but also the occurrence of such a bug, due to short-term input output is not directly proportional to the final.

Automation or the strength of the team, it is difficult to achieve large-scale automation alone, the coverage is relatively narrow, it is difficult to see the results. So the point is to continue this is the fate of functional testing, but also to continue the automation ... Because I don't want to stay with my team forever at a point point.

The Robot framework is a functional automated testing framework written by Python. With good scalability and support for keyword drivers, you can test multiple types of automated test-taking for the client Web, Android, iOS, and API at the same time. And it's an open source drip. The above has basically included my choice of reasons, but also focus on.

Python Authoring

It's obvious that Python is a good choice when it's not a development experience to test what language is better. Easy to get started, the code is simple, no need to compile, seal the rich library resources is to do what you want to do, and Linux can play directly for some cumbersome shell.

Open Source

We have no money, we just like open source, although we have not been able to contribute to the open source organization, but with their open source software is a little support for them. And thank them in some!

supported types of clients

Now that big half of the sky is already part of the mobile internet, it's clear that the only tools that support traditional Web testing are not enough, that RF supports both Android and iOS functionality testing, and of course, http,webservice and other types of API testing.

Good Scalability

RF itself has a wealth of test library resources, such as Selenium2library, Requestslibrary, databaselibrary, etc., then it can also support the custom test library, RF provides a variety of ways to customize the test library, you can also have their own key font. (a bit like JMeter custom plugin)

keyword driver

Keyword driven and data driven all along, the test community has been explaining how to explain and differentiate their respective holdings. I also don't want to explain how much time they spend because they follow the input and output of the software test, but here's what I'm going to say about the test design. See figure two below

Figure 1 is a data-driven, read test data, write test steps, determine the expected results, the intermediate steps can be a process-oriented operation, as long as the implementation of the steps to ensure that there is no error, in the absence of changes in the business, the need to focus on the test data construction and maintenance, rather than directly maintain the script, The same process can be used to test different data inputs.

But once the business changes, the entire step will be reduced to a large area of the modification, the process-oriented code implementation of code may be large, at this time, the maintenance of a large degree of difficulty.

In Figure two we can see the data driven, but what happened, the data is divided into local data and global data, each step has its own private data of course also can not (a bit like the public and private variables), all the control by the keyword to complete. In maintenance we can control the global variables to control the test results of a batch of case, and can control the input data of a single case.

In addition to the maintenance of the process we only need to maintain the key words (objects) that perform these control steps, rather than a large number of code statements.

The closer look is more like a process-oriented software development and object-oriented software development, object-oriented is also based on the process-oriented, which is the production of it progress. Just like Dad, Son is better, there is not much need to discuss who is who, is a family.

Robotframework (1) Keyword driven test framework

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.