restif-statementloadrunnervugen

How to use if condition in load runner to verify web_reg_Save_param() value?


I am trying to verify web_reg_Save_param() value in if condition but not able to verify please provide me the solution and i have used if condition as

if(lr_eval_string(Gmessage==Smessage))
    {
        lr_end_transaction("10_GetSecurity_Token",LR_PASS);
    }
    else
    {
        lr_end_transaction("10_GetSecurity_Token",LR_FAIL);
    }
    //lr_end_transaction("10_GetSecurity_Token",LR_AUTO);
    return 0;

Where i am getting Gmessage as Success in web_reg_save_param(), please help how to verify to check valid and invalid for json response.


Solution

  • Alternative/Simple Way:

    1. Capture the response(for ex: c_Response=Success)
    2. Use below code for validation:

       if(strcmp(lr_eval_string("{c_response}"),"Success")==0)
          lr_end_transaction(....,LR_PASS);
      else
          lr_end_transaction(....,LR_FAIL);