Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

Programming of Http Protocol Interface in laodRuner

Shulou Source: shulou.com Published: 2022-06-02 21:34:06 10月03日 Update

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

Tags: Characters strings functions messages scripts tests two seniors constants conditions positive numbers negative numbers differences health success medium pressure random codes excuses content pressure Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Microsoft Shulou Tech Info Linux macOS Redmi