0

I am not sure what's going wrong. I want to use if condition to compare the statuscode of webcall in vugen and handle the transaction based on that.

c_statuscode = 409 // it is the extracted value showing in logs

    if (atoi(lr_eval_string("{c_statuscode}")) == 409){
        
        lr_output_message("request already exist"); 
        
    lr_end_transaction("transaction",LR_PASS);
    
    Action();
    }
    else{
    lr_end_transaction("transaction",LR_AUTO);
    }

it's suppose to compare the status code and print output message as is in lr_output_message function, and end the transaction and again go to perform the Action() part. and if "if" condition doesn't match it should end transaction.

Vikash
  • 1
  • 1

1 Answers1

0

For your comparison, see strcmp()

For your status, see web_get_int_property()

Note, your If condition code is outside of a handling function. If you want to make the rest of your action dependent upon this code, then it needs to be included, such as (PCODE)

Action()
{

\\ Some code runs to set the condition for evaluation

If (condition true) then return(1);

\\ The code from here down will execute if the above condition is false
\\ When true the return(1); will cause an immediate start over of the
\\ iteration.  Return(0); respects pacing information in the run time 
\\ settings.  A return(-1); kills the virtual user

return(0);


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