Performance Testing Old

Get Token and Test Performance of API

***************************

My_Action()
{

web_set_sockets_option("SSL_VERSION", "TLS1.2");
web_reg_save_param_ex(
"ParamName=MyID",
"LB/IC=",
"RB/IC=",
SEARCH_FILTERS,
"Scope=Body",
"IgnoreRedirections=Yes",
LAST);

web_rest("GET: <URL>/...",
"URL=<URL>",
"Method=GET",
"Snapshot=t304417.inf",
LAST);

web_reg_save_param_ex(
"ParamName=APIStatus",
"LB/IC=highestSeverity",
"RB/IC=",
SEARCH_FILTERS,
"Scope=Body",
"IgnoreRedirections=Yes",
LAST);

lr_rendezvous("My_Rendezvous");
lr_start_transaction("My_Transaction");

web_rest("POST: <URL>...",
"URL=<URL>",
"Method=POST",
"EncType=raw",
"Snapshot=t530999.inf",
"Body={ \"awbNumber\": \"{AWB}\", \"originCountry\": \"BR\"}",
HEADERS,
"Name=X-CSR-SECURITY_TOKEN", "Value={MyID}", ENDHEADER,
"Name=Content-Type", "Value=application/json", ENDHEADER,
LAST);

lr_end_transaction("My_Transaction", LR_AUTO);

lr_output_message( "Destination Postal Iterationwise %s", lr_eval_string( "{{AWB}}" ) );
lr_output_message( "API Status %s", lr_eval_string( "{{APIStatus}}" ) );

return 0;
}

No comments:

Post a Comment