Review Performance Test Tools OpenSTA.
Author:
Pingping Pingping
Keywords: Performance Test, Test Tool, OpenSTA
Summary:
This article will introduce a free, source code open Web performance test tool OpenSTA, including its principle, component, and a process of recording scripts. In addition, how to introduce variables in OpenSTA's test scripts, and give variable value different values, for example, set the user name of the login to the test website to a variable, when performing performance test, virtual multiple different users at the same time Log in to the test website, verify that the variable is assigned to different values during the test execution by the method of printing the user name of the website.
text:
As a test engineer, it is impossible to focus on the functionality of the system, but also a comprehensive test of the system to confirm whether the system meets the needs of users. So what is the performance test?
"China Software Evaluation Center summarizes performance tests into three aspects: Applications on client performance tests, testing on network performance testing and testing on server-side performance tests. Application in client performance test is to examine clients The performance of the application, the entrance to the test is the client. It mainly includes concurrent performance testing, fatigue strength testing, large data quantity testing, and speed testing, which is the focus. "(" Performance Test: Software Test heavy "author: China software Testing Center issued a document time: 2003.08.26)
Currently, the more famous concurrent performance test tools have Rational Robot, Qaload, Loadrunner and Microsoft's WAS. This is the Qaload, LoadRunner, Rational Robot is a more good commercial test tool (very expensive), Microsoft's WAS is a free test tool, which is relatively simple, but because cannot be displayed and edited the recorded test script It is weak, so that there is a weak limitability.
OpenSTA is dedicated to the B / S structure, free performance test tool. In addition to free and source code open, it is also possible to edit the recorded test script and edit it according to the specified syntax. After the test engineer is recorded, you only need to understand the specific syntax knowledge of the scripting language, you can edit the test script to facilitate performing the required parameters when performing performance test again, and then performs specific performance index analysis. OpenSTA makes everyone a deep understanding of the principles of performance tests, and its more rich graphical test results greatly improve the readability of test reports.
OpenSTA is based on Common Object Request Broker Architecture.
The structural system of CORBA). It is through virtual a proxy, using its dedicated script control language, record all HTTP / S Traffic through Proxy. The test engineer analyzes the performance indicators collected by OpenSTA's performance index collector, and HTTP data, and analyzes the performance of the test system.
First, what components are OpenSTA?
u OpenStacommander - Main control application;
u Nameserver - CORBA background processor to ensure communication between the various components of OpenSTA;
(Nameserver is installed while installing OpenSTA, when running properly, you can see the icon on the right side of the Windows Taskbar.
If there is no normal operation or stopped, the icon is displayed as
. )
u ScriptModeler - Configure, start HTTPGATEWAY toolbox, and also the tool program for recording scripts;
u httpgateway - analog Proxy processor, perform recording; (Accept user manually configured Proxy settings, do not accept any automatic configuration proxy mechanism);
U Testexecuter - Really performs the background processor;
u WebRelayDaemon - Filter CORBA restrictions on the Internet using XML RPC;
u repository-test script, configuration and test results storage directory;
u TestManager - Manage test running background procedures;
u Taskgroupexecuter - the processor running TaskGroup.
Second, what is a performance index collector (即 collector)? This is a set of issues defined by the user, which determines which performance indicators in the test requires records. Includes two types:
1) NT Performance Collectors is used to capture the performance indicators of host running WinNT or WIN 2000.
2) SNMP Collectors is used to collect the host and other SNMP data running the SNMP Agent or Proxy SNMP Agent.
Collector's settings will be described in the following to record the test script.
Third, how to record test scripts?
1. After installing OpenSTA, the three tool programs of OpenSTA appear in the "Program", as shown below:
Figure
1-1
Post-installed interface
Check that the OpenSta Nameserver status is running, that is, the icon is
,
Run "Opensta Commander", the interface is displayed below:
Figure
1-2
Running interface
2, record new script
1) Mouse points "scripts", generate new scripts by right-click menu "New Script" -> "http", the script name is default to newscript (as shown below);
Figure
1-3
Script interface
2) Double-click the new script, open the Script Modeler window, set Browser and Gateway in the Options menu, in general, keep the Gateway default settings;
Figure
1-4
Recording scripting interface
3) Press the red ball in the toolbar to automatically open the specified browser, enter the system URL that you want to record, display the home page of the test site. After the successful landing is successful, each established operation step is performed. Press the box button on the toolbar or exit the browser directly, stop the script recording, which is the recorded scripting statement in the Script Modeler window.
3, generate Collector
1) The mouse point "Collectors", generates a new indicator collector by right-click menu, default is NewCollector;
Figure
1-5
Generate collector
2) Browse and set the performance metrics that need to be collected via Browse Queries. (The meaning of each performance indicator is not the content contained in this article, not introducing here)
4, constitute a test environment
The same method is the same as the script and performance collector, in Tests, create a newtest (the new Test has been renamed in the picture below), dragging the test script and performance index collector to this test, as shown below;
Figure
1-6
Test environment interface
5, according to the toolbar, execute the test, you can view the contents of the "Monitoring" tab during the test. After the test is over, the page sign is empty;
6. After the test is completed, the Results tab below the point tool button displays the recorded test results data, as shown below. Figure
1-7
Test results interface
At this point, the reader should have a probably understanding of how to use the OpenSTA test tool. If you need to learn more about the details, you can view the manual of the tool, but it is e-text :). Friends who need to download Opensta tools can access the website
Http://www.opensta.org/, can also download on this website.
Below, describe how to introduce variables in OpenSTA's test scripts and give variable to different values. Network application systems generally have a landing page that requires the user to enter the correct user name and password. After the system is verified, the user can enter the application system. When using OpenSTA Recording the test script, the input user name and password will be recorded in the script by the OpenSTA, and after the recording is complete, you can find the following statement in the script file:
Here "Mike", "Ekim" is the user name and password entered by the login system when the script is recorded.
The problem is that when performing performance testing, there is often a need to simulate a number of different users at the same time, and the performance indicators of the system are observed. Record of separate test scripts for each different system user is unrealistic. Then, how to modify the recorded test script so that it can simulate multiple different virtual users during the test, and each virtual user user name and password are written to the test script?
1. First, add the variable username, Password definition to the definition section of the test script:
Here, Mike, Allan, David, Robert is the correct user name, EKIM, NALLA, DIVAD, TREBOR, which is the system of the system, is the login password of these users.
(Note: OpenSTA test script is three parts, Environment, Definition, Code)
2, at the same time, add the definition of the variable my_username, my_username, my_password:
Character * 512 My_USERNAME, LOCAL
Character * 512 My_Password, Local
(Note that these two variable ranges are LOCAL types)
3, in the sending login request, "Primary Post Uri" http://demositive.opensta.org/gsg-v1 http / 1.0 "on 2 ....", add the following statement:
Acquire Mutex "Login"
Next username
Next Password
SET MY_USERNAME = UserName
SETM_Password = Password
Release Mutex "Login"
among them:
The meaning of the Aquire Mutex command is: set the variable username and password to the first value in the two variable selection sequence sequences in the user name and password, and set to local form to avoid other virtual users to use this value;
The meaning of the release mutex command is: Release MUTEX, other virtual users can select the first value in the sequence (the value in the sequence is cycled);
Here, you need to explain the meaning of the MUTEX lock mechanism, and when multiple virtual user tests are avoided, the phenomenon of selecting the same value is automatically selected from the variable selection sequence (ie, the same user is selected);
4. Replace the username and password of the Body PRIMARY POST statement that sends the login request to the variable: So far, the modification of the test script has been completed. According to the OpenSTA operation steps mentioned earlier, set the performance test collector, set the number of virtual users to 4, start testing, OpenSTA will simulate Mike, Allan, David, Robert, 4 different users of the landing system Happening. Speaking here, the reader may ask, how to verify that during the test implementation, it is indeed simulated that these users are logging in? We can verify the method of printing all the user names of the landing system.
The method is to add a Report statement after sending the Primary POST statement of the login request:
Report "User", My_USERNAME
Thus, after the test is completed, the print-out login user name can be seen in the Test Report log. (Is it very simple? You can try it)
The author performs experiments in their own test scripts, setting the virtual user to 3, add the Report statement after login request statement, the following is the test end after the test end Test Report Log Information
Figure 1-8 Test results
Here, "admin", "sjcj", "data" is the three user names of the test system.
Through a series of suits, everyone should have a certain understanding of the Web performance test tool OpenSTA. How to use this tool to use this tool, collect the performance indicators of the system to perform performance analysis, I hope everyone will discuss.
references:
1. Opensta User Manual
-------------------------------------------------- --------------------------------------------
[
About the Author]
Name: 缑 缑 萍: Women, in the software industry has nearly 10 years of experience, before and after the work of technical support, C software development, process management, and software testing, and master the master's degree in engineering management during the UK. So far, it has been done more than a year of web application system software testing, which is very interested in this work, and there are some experience. The test industry has developed abroad has been more mature. In the country, it gradually attaches importance. The author hopes to introduce foreign advanced techniques and philosophy to domestic counterparts to rapidly improve our software. Test level.