Loadrunner Performance Test http interface

Author: Yu navy

 

  Performance testing tool of choice is loadrunner. However, loadrunner do not like web interface testing time and will lead directly to record a script, you may not know how to do it. In fact, loadrunner do http interface performance is also very simple. Upon receipt of the performance test http interface, we must first understand this type of interface is a get or post type. Then we look at each of these two test methods of the interface type.

 

A, get type of interface

 

        get type of interface, which is an additional request parameters in the url, send the request directly to web_ur, such as:

 

web_url("getname", 

"URL=http://192.168.106.193/shop/business/QueryMdseDetailById.action?name=something&&password=something",        

"Resource=0",

"RecContentType=text/html",        

"Mode=HTML",        

LAST);

 

        Interface is with the above two parameters, name, and password. && connection between the parameters and parameter.

 

        The above code into loadrunner of action, the transaction plus the start and end of the transaction. This interface test script is complete.

 

        Then, like debugging test scripts as web, parameterization, set the scene for a stress test interface.

 

        Note: The code needs to replace the URL in the URL test interface.

 

Two, post Interface Type

 

        post type of interface, which is placed inside the body parameters, the request may be sent using web_submit_data, web_custom_request.

 

1, web_submit_data format:

 

web_submit_data("postname",

"Action=http://192.168.106.193/shop/business/QueryMdseDetailById.action",

"Method=POST",

"RecContentType=text/html",

"Mode=HTML",

ITEMDATA,

"Name=name","Value=something",ENDITEM,

"Name=password","Value=something",ENDITEM,

LAST);

 

        The above two interfaces with the parameter name and password, attention returned RecContentType result type, if it was json string, RecContentType = application / json.

 

2, web_custom_request, the following format:

 

web_custom_request("getTeacherClassList",  

"URL=http://192.168.106.193/shop/business/QueryMdseDetailById.action",  

"Method=POST",  

"Resource=0",  

"RecContentType=application/json",  

"Referer=",  

"Mode=HTTP",  

"EncType=application/x-www-form-urlencoded",          

//"Body=",  

"Body={\"teacherId\":\"165\"}",            

LAST);

 

        This interface with a parameter userId, json returned result is a string format. Json body will be placed inside the quotation marks need to be escaped.

 

        It recommended post web_custom_request interface to send the request.

Guess you like

Origin www.cnblogs.com/ustcinfo-qc/p/12123671.html
Recommended