Programming of Http Protocol Interface in laodRuner
Requirements: These two days trial Windows sockets protocol to write scripts, suddenly said to test the application service pressure, after consultation with the development is to use http protocol, no script can be recorded, from the loadrunner comes with a function to check can use the web_custom_request function to write, then through Firefox plug-in: HttpRequester reference, plus online seniors to provide help, then write the following script:
Test and pass.
If a problem is found, the pressure test in loadrunner can return a message, and the search conditions can also be correct. But the database found that the results, Chinese appear garbled; Hope who can point under;
Action()
{
char* Recode="000000"; //add correct judgment condition
char* WebRecode; //Define the value of the correlation function
web_reg_save_param("yanz",
"LB=",
"RB=",
LAST);
web_reg_find("Text=000000",
LAST);
lr_start_transaction("ABC_trial");
web_custom_request("web_custom_request",
"URL=[ip]", //IP address of message
"METhod=post",
"Resource=0",
"Referer=",
"Mode=HTML",
"RecContentType=application/json",
"EncType= text/xml;charset=UTF-8",
"Body="
//Message content
""
" "
"20151102 "
"140854
"1002 "
"11