With a robotic frame. NET Automation Testing

Source: Internet
Author: User
Tags jenkins ci

?

Clayton Neal has over 13 years of experience in software testing and quality assurance, including eight years of experience in testing automation for Windows, Web, and mobile applications . He has worked at all levels in the field of testing. Recently he worked as QA Manager in Bloomberg and Misys. He is also an automated testing consultant for Sogeti. Clayton is obsessed with automated testing and has seen how to successfully implement test automation in person.

?

The benefits of test automation We are well aware that faster feedback problems, fewer manual tests, and continuous integration are just some of the things you can do. The more Test team members, the more automation the company uses, the better. To do this, we must go beyond the technical aspects of implementing Test automation and consider the non-technical staff level of writing and running automated tests. Whether the development team is doing agile acceptance test-driven development (ATDD), agile behavior-driven development (BDD), or using traditional waterfall methods, the more members the team can use to automate, the more extensive the automated testing coverage will be.
Keyword-driven testing is a way for an automated engineer to develop reusable behavior within the application under test. Non-technical users can then use any input parameter to sort the resulting reusable keyword behavior Library and determine the test case. For example, a keyword can be a click button (click on a button control) or enter text (enter text in a text box control), then these keywords can be used to fill out a login form and click the OK button. The advantage of this approach is that automation engineers focus on the scripts or programming of the test automation that they specialize in, that is, the development of keywords, and that non-technical testers and enterprise users use these keywords and write test cases based on their domain and product knowledge, ultimately making automation more effective.
? The robot framework is a generic keyword-based test automation framework that does not rely on any particular automation tool (e.g. QTP, Ranorex, testcomplete, selenium, etc.), but allows automation engineers to insert keywords with such automated tools. The robot has installed many keywords and has a very mature feature set, including: keyword conditional execution 
? Test cases and test sets [Setup] and [teardown] 
? Data-driven keyword files, directory and process management for loops 
? HTML Test Report 
? Jenkins CI Integration transforms the variable into a keyword and returns from the keyword callout of the test case keyword 
The last feature listed is the ability to create keywords on existing keywords to ensure the growth of the keyword pyramid shown in 1.

The bottom of the pyramid is a technical keyword developed by an Automation engineer: The top is the functional keyword for a single functional behavior within the application: Finally, we summarize the business process keywords based on the functional keyword to build the business process within the application. An example of this layering is shown in table 1.

Table 1. Keyword layering

Here, the technical keywords are based on the automation behavior that runs with the display controls; The functional keywords run a single functional step in the application, and the higher-level business processes test the end-to-end processes within the application.
The robot framework allows you to load new keywords from python and Java libraries, in order to use the. NET, you should use the remote service interface. The interface is the Xmlrpc interface, where the robot framework sends a request to a remote service to execute a keyword. Of course, this remote service can be developed in any language that supports XMLRPC. In particular, a remote service can be used. NET development allows the robot framework to execute keywords that are based on. NET in the keyword assembly. This method is shown in 2.

Figure 2. Remote Service structure diagram

n Robot remote (see http://code.google.com/p/nrobotremote/) is one that can be built. NET key font and exposes it to the robot framework's. NET Robot framework remote server via the XMLRPC protocol. The combination of the N Robot remote robot framework allows the initial automation to plan which tests need to be automated and what keywords they need to develop, rather than designing an automated framework before the automated test plan can begin. The remote development of the. NET keyword for n robots is just a class for developing a public method. Each method is treated as a keyword-for example:

This keyword class exposes two keywords: Clickbutton and entertext. By creating a keyword class in the N robot remote and pointing the robot frame to the XMLRPC address, these can be implemented using the automated test tools of choice and can be called through the robot framework. As shown in 3.

Figure 3: Robot framework test Case using N-Robot remote

In the above example, set a column to tell the robot frame that there is a remote keyword service on the http://localhost:8271 (note: In addition to the local host, it may be on another machine), and the keywords from the remote server will have the prefix N robot remote (any prefix can be). Test case A column defines a test case called Administrator login, call the keyword Entertext to enter the user name and password, keyword Clickbutton click OK. Such a test could have been written by a non-technical tester or enterprise user in the early stages of development. The key font itself can be viewed as a thin layer above the domain model of the application being tested. For example, if you use the Selenium Page object, the keyword layer can be shown in 4, sequentially invoking the Page object and method.

Figure 4. Keywords and domain layers

This abstraction provides flexibility in changing the application under test, and often, when applications change, only domain models and keyword implementations change. The test case implementation does not have to be constant because it is built at a higher level. Use the robot frame and. NET keyword can also enable different automation tools to integrate with each other at the test case level, giving automation engineers the flexibility to choose the best automation tool for the desired keyword behavior. For example, if in a larger company, several automation teams have been selected to use different automation tools for different product modules, each team can develop a domain model for its modules in their own development language, such as a robot framework that can load Python, Java and (via N robot remote). NET keywords. Test case writers can also use keywords from all automation teams in their test cases.

  Summarize
By allowing non-technical users to write test cases at various stages of development, the automated behavior from abstraction to a reusable keyword that can be passed on to non-technical testers and business users to reduce the bottleneck of automation engineers. The robotic framework, as a mature generic keyword framework, allows automation projects to focus on automated testing and the required keywords, rather than designing and implementing a test framework. Using robot frames and n bots to extend keyword test automation to. NET, allows keywords to leverage the benefits of the. NET Framework and automation tools in. NET, and allows the combination of keywords from python and Java with the same test cases.

Copyright notice: This article from SPASVO Software Testing network: http://www.spasvo.com/news/html/2014101194841.html

Original works, reproduced when you must be in the form of hyperlinks to the original source, author information and this statement, or will be held liable.

?

With a robotic frame. NET Automation Testing

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.