Software Testing Architecture

Source: Internet
Author: User
Tags testng selenium grid

These "automated test framework ideas" will now be presented according to your own personal understanding:

1, the so-called modular thinking , is a test case in a number of different test points of the split and its single point of the test steps are encapsulated, forming a module.

For example: A test case to test a login program, including: User name input, password input, and determine login;

Then you can enter the user name, password input, determine login, cancel login Four operations are encapsulated in four different modules. When testing, just call its module. In this case, when a module changes, you only need to maintain the module alone, or you can combine the different modules into different test cases.

2, the so-called Test library idea , is the sublimation of the modular thought, which created the library file for the application test (can be APIs, DLLs, etc.), these library files are a series of functions of the collection. It is different from the modular thinking, it expands the interface idea, that can pass the interface to transfer parameters, rather than a dead module, can be said to be a more "door" interactive module.

For example: or the above test case, just the user name input, password input, determine login, cancel login encapsulated into a library, this library contains a function login, this function login to receive two parameters "user name, password", to enter a different user name and password can be different test cases. You can also cancle a different function.

3, the so-called data-driven thinking , a lot of people feel that just rely on the excle table for different data reading is only a high-level parameterization, in fact, how to understand is not important, the key is that its ideas can be applied to your framework. My understanding is that variables are constant, data-driven results, and different data leads to different results. For data import, there are many ways, such as: Excle table, XML (used in the web), database (db), CSV file, TXT, etc. can be.

4, the so-called key words of thought , this thought, I have been thinking, it and object-oriented relationship, and interactive modular thinking of the difference. Later personal understanding, in fact, the keyword driver is an object-oriented thinking, for example: QTP, RFT, the object can be a data or a keyword, the object can be captured, the test object may be encapsulated as a keyword (that is, the GUI elements can be encapsulated into a keyword), This allows for a variety of operations on its key objects, and different objects can drive different test flows and results.

The simple way to apply it is to use an Excel table, which includes "Object Type", "Object Name", "Object operation name", "Judging Way" "expected result". In this way, you can build a test case table by importing different object types and names, and different object operations.

The above is only a personal understanding of these ideas, do a good job of automated testing, not that you have mastered a framework, but to master the idea of automation, and then based on these ideas, combined with your different test environment and processes to build your own automated testing framework.

III. Strategies for building automated test frameworks

1, always remember, your "Automated testing framework" is for testers, if you really want to make automated testing a scale, then you need to use the test engineer as your user, you can not expect them to be patient to write test scripts or expect them to be like you have a good grasp of these ideas. You have to think of them as users who do not understand anything, so your framework must be the embodiment of "all simplification", simple operation, simple maintenance, simple expansion.

2, to do an automated testing framework is mainly from the stratification to consider, rather than a simple application of a thought, it is a collection of ideas.

For example, to do a GUI automation test, the simple general will be divided into three layers, the framework is as follows:

Among them, can run through the various ideas of automated testing, such as: The object layer has the idea of keywords, you can mark the object library in an Excel table for management, or apply dynamic search method to pass object recognition parameters. The tasks layer can encapsulate various methods to form a large library of methods that can be applied to data-driven ideas in each method.

3, the real automated testing framework is combined with the process, and not simply by the technology to achieve, technology is not very complex, the key lies in its structure and process of deep grasp, and this takes a long time, so do not expect to eat fat, can only step by step according to demand, the application of the guiding ideology.

2.1 Common Test architectures
Modular test Script Framework: The script for the test case is composed of a tree-like, individually-small, test script module that can be described for modularity.
Test Library Framework: Unlike modularity, the target application is decomposed into procedures and functions rather than scripts.
Keyword-driven test framework: Maps the functionality and test steps of the target application to the form of the keyword and driven driver tables, respectively.
Data-driven test framework: Test drive modules get test data from the data source for testing.
Hybrid test Framework: Some of the above frameworks are combined.

Layered Test Framework:

2.3 Platform Implementation
2.3.1 Platform implementation based on selenium and testng
First, download and install the Selenium ide,selenium rc,selenium grid installation package separately from the Selenium official website. Download and install the testng installation file from the TESTNG official website.

Software testing activities are conducted around test cases, and for Web automation testing, the basic steps are as follows: Write test cases, record test scripts, configure test engineering, run test scripts, and view test reports.

For the development and execution of test scripts, it is necessary to use the Selenium IDE for script recording, debugging, playback, and then determining the script code for a specific language, such as Java code converted to the TESTNG framework, after the test case. You then need to refactor the converted test script code to separate the business and control scripts into different modules while refactoring the test data, including business test data and interface data (you can use XPath to locate the interface element). During refactoring, test scripts are set up and controlled by using TestNG's annotation tags. Test reports are automatically generated by testng in the test, can be opened directly using the browser, or can be extended to the server, so that the relevant programmer can immediately get their own part of the test results.
3 Conclusion
Software testing layered architecture is based on the hybrid test framework, the combination of layered thinking design, through selenium and testng platform, can be widely used in Web application automation testing,

Software Testing Architecture

Related Article

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.