0

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.

teo van kot
  • 12,350
  • 10
  • 38
  • 70
Rajesh Om
  • 483
  • 2
  • 15
  • 39

4 Answers4

1

FoundationSkills - Language of your test tool.

I will recommend a book that I own and one which I have recommended to relatives to address this issues, http://www.c-for-dummies.com/

It is a good book. Easy to follow. This will address your foundation skills issue in the 'C' programming language. My copy sits on my shelf among a dozen or more bright yellow "For Dummies...." books

Community
  • 1
  • 1
James Pulley
  • 5,606
  • 1
  • 14
  • 14
1

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);
    
Basava
  • 42
  • 4
0

you have to use c string manipulation functions like strcmp or strstr functions.

sivaramaraju
  • 352
  • 2
  • 8
0

I take it you have 2 parameters Gmessage and Smessage, you can compare them with lr_checkpoint()

lr_checkpoint("StepName=VerifyCheckpoint", 
    "ExpectedValue={Gmessage}", 
     "ActualValue={Smessage}", 
    "Compare=Equals", 
    "StopOnValidationError=true", 
    LAST );
Michael Galos
  • 1,065
  • 3
  • 13
  • 27