Performance Testing
*****************************
vuser_init()
{
web_reg_save_param_json(
"ParamName=MyBearerToken",
"QueryString=$.access_token",
SEARCH_FILTERS,
"Scope=Body",
LAST);
web_rest("POST: https://",
"URL=https://url.com/oauth2/default/v1/token?client_id=<ID>&client_secret=<secret>&grant_type=client_credentials&scope=Custom_Scope",
"Method=POST",
"EncType=raw",
"Snapshot=t170780.inf",
HEADERS,
"Name=Cache-Control", "Value=no-cache", ENDHEADER,
"Name=Content-Type", "Value=application/x-www-form-urlencoded", ENDHEADER,
LAST);
lr_output_message( "Response Bearer Token ID >> %s", lr_eval_string( "Bearer {MyBearerToken}" ) );
return 0;
}
Action()
{
web_reg_save_param_json(
"ParamName=TeamWorklistResponse",
"QueryString=$.responseDescription",
SEARCH_FILTERS,
"Scope=Body",
LAST);
lr_rendezvous("CC_Rend_WL_BE");
lr_start_transaction("CC_Team_Worklist_BE");
web_rest("GET: https://",
"URL=https://<API URL>",
"Method=GET",
"Snapshot=t416456.inf",
HEADERS,
"Name=Authorization", "Value=Bearer {MyBearerToken}", ENDHEADER,
"Name=carrier", "Value=FEDEX", ENDHEADER,
"Name=clearanceProcedure", "Value=IMPORTS", ENDHEADER,
"Name=competencyId", "Value=3", ENDHEADER,
"Name=competencyName", "Value=CUSTOMER_CONTACT", ENDHEADER,
"Name=xGeminiToken", "Value=<User code>", ENDHEADER,
"Name=country", "Value=BE", ENDHEADER,
"Name=Location", "Value=ALL", ENDHEADER,
"Name=userId", "Value=760036", ENDHEADER,
"Name=xUserRole", "Value=ADMIN", ENDHEADER,
LAST);
lr_end_transaction("CC_Team_Worklist_BE", LR_AUTO);
//lr_output_message( "Response %s", lr_eval_string( "{TeamWorklistResponse}" ));
if (strcmp(lr_eval_string("{TeamWorklistResponse}"), lr_eval_string("Team Worklist successfully fetched along with the user preference")) == 0)
{
lr_output_message("CC Team Worklist Reponse BE >> %s", lr_eval_string("{TeamWorklistResponse}"));
}
else{
lr_error_message("CC Team Worklist response BE >> Failed");
};
return 0;
}
No comments:
Post a Comment