6), Debug verification
After the script recording is complete, it is generally not going to run, and the script must be adjusted and enhanced. Adjustments and enhancements that need to be made generally include:
1. The role of each request needs to be understood, for some slices, CSS and other resource requests can be ignored or even directly can be deleted, because the general performance test is the business logic and processing of stress testing.
2. For submission parameters such as submit request attention, respectively understand the role of each request, and analyze whether the request parameters need to be parameterized, whether the parameters with the user, time, the number of requests changed. (parametric details to explain later)
3. Focus on the request to control specific business operations, with particular attention to the URL in the request or the parameters in the submission, generally these parameters for the control of some business operations, such as a request to view the order, the URL may contain the order number or the user encrypted information and other key information, At this point, if the stress test is the function of the query order, naturally need to parameterize these parameters, but how to parameterize it, because like the order number of this thing is returned to the client side of the server. It is not possible to randomly generate it to the server directly on the client side. Therefore, it is necessary to use another important function----Association, the association is when the server generated the order number and passed to the client, the first save this parameter, and then in the subsequent operation need to use the order number, this parameter to the corresponding parameters of the process, this saving and parameterized action , the LR performance test is called correlation. (The specific principles of association and the use of follow-up to explain)
4. For the use of checkpoints and check logic, generally we will add some pictures and specific text in the script as checkpoints, such as we request the homepage, there will be some welcome text, etc., as long as we can find in the request response to such a word, the request is considered successful. There are some specific pictures such as only this page has this picture, then I request this page as long as the response returned this image, the request was considered successful. These special properties are flags that can be used as checkpoints to determine whether script execution is successful. Of course, a special response character in response can be used as response code and response status in response: Code:0success, etc. As for logical judgment, it is generally based on the judgment of words, for example, in judging the existence of words, we first give a token to find out the value of the check that is, the request is successful, and then in a logical processing, if (found character) execution statement block; Else EXECUTE statement block So that after the request is completed and the response is successfully obtained, the next step is taken, otherwise the operation will be performed.
5. Transaction definition: For the script, the same operation or a number of actions related to the request can be defined as a transaction, such as the action of the lottery, can include the acquisition of color period, submit order data, confirm payment data and other related critical requests. Of course, this business is my own definition, the name of their own arbitrary, define the purpose of the transaction is to more detailed monitoring and evaluation of the specific process operations, the other one also makes the script clear and easy to read, so long as it does not violate this fundamental purpose, how to define the line, to see their preferences.
6. Complete the previous 5 steps, you can start playback debugging, in the debugging can be run-time setting log this item of the extended log parameter subsitution tick, so you can see the debugging parameters of the specific value of all parameters, Verify that the parameters are correct once again. After the script is executed, in addition to looking at the log error, you also need to confirm whether the data is in storage and the response of each request is abnormal, and open view-->test result to see the response of each request. After the commissioning, the script writing phase of the work, even if completed, the next is the real stress test of the build scene.
Instance:
Web_reg_find ("text= Current Day",
if (Atoi (lr_eval_string ("{count}")) >0)
{
Lr_output_message ("Login Successful");
}
Else
{
Lr_output_message ("Login Failed");
}
6.1 Parametric Explanation:
First of all, I'm going to balabala the concept and significance of parameterization, what is called parameterization: parameterization is when we record a script, or write the values that are written dead in the commit request, but these values will be a result of different submission requests or changes in user requirements, The essence of this is that each submission strives to make this parameter worth updating. So why parameterize: Simply put, in order to better meet the needs, so that the simulation of the submission of data more in line with the real data. For example, the test login function, if not parameterized, then all the submission request is the same user to do the login operation, although not necessarily each system to the user login limit value allows the same user to log in at the same time, in the system without this restriction, test the concurrency of the login scene, Using an account to do concurrency and use a lot of different accounts to do concurrency, in the submission process may seem to be nothing different (server-side cache), but from the data, it seems too unconvincing, at least the real situation is not so, so in order to more closely simulate the real environment effect. (Of course there are other reasons, such as the server-side cache just mentioned, if the same user is constantly going to concurrency, then actually log in the operation of some of the query is not to go to the library, go directly to the cache, this is not consistent with the actual situation of our needs. )
Reprint to: (Owenhe Source: http://www.cnblogs.com/7test/articles/4778743.html)
Concept point analysis and process explanation of performance test (II.)