LoadRunner Practitioners Forum
Showing results for 
Search instead for 
Do you mean 

Storing the Error transaction(if parameter causes transaction to fail) into a File

Highlighted
Advisor

Storing the Error transaction(if parameter causes transaction to fail) into a File

Hi Folks,

 

When a load test stared in the controller and while it is running, In any case if the script get some error at paricular transaction/line due to wrong paramter value then is ther any idea/inputs of getting that parameter value and storing into a file.

 

Thanks,
Remo

3 REPLIES
HPE Expert

Re: Storing the Error transaction(if parameter causes transaction to fail) into a File

You can use one of the extended log options for the script, the one for parameter subsitution in Run Time Settings, while the script runs you can see what parameters where being taken by the vuser in your run.

 

Regards,

Mario M.

HP LR/PC Support

If you are customer you can try posting on our internal forums for more personalized support.

LoadRunner:
http://h30499.www3.hp.com/t5/LoadRunner-Support-Customer/bd-p/loadrunner-support-customer-forum

Performance Center:
http://h30499.www3.hp.com/t5/Performance-Center-Support/bd-p/performance-center-support-customer

How to:
http://www.youtube.com/watch?v=4ChlysWupWM

If you find that this or any post resolves your issue, please be sure to mark it as an accepted solution.
Frequent Advisor

Re: Storing the Error transaction(if parameter causes transaction to fail) into a File

Hello!

 

Try to do the following:

 

  • At the beginning of the script enter the command "lr_output_message ("# Start # %s #", lr_eval_string("{CustomerID}"));" in this case "CustomerID" is my parameter name - you have to change it to your parameter name!
  • At the end of the script enter the command "lr_output_message ("# Ende # %s #", lr_eval_string("{CustomerID}"));"
  • Turn of the logging of the script.
  • Execute the script in VUGen with as many iterations as you have parameter values.

 

Iterations that fail because of parameter problems will show only the first output message but also an error message. At the end select the paramters that failed and delete them from the list.

 

Kind regards

Thomas

Valued Contributor

Re: Storing the Error transaction(if parameter causes transaction to fail) into a File

u need to write custom error handlig code, some thing like,

 

specify lr_continue_on_error(2); and flag=0 in action file starting

 

Assign each lr parameter to a variable before using (assume as comm_var)

 

Make sure flag=1 at end of the action file.

 

Create a new action and open a file in Append mode.

action2()

{

if(flag==0)// this block will execute when the flag val becomes 0, which means script not executed till end of the action file (error occured)

{

 

//file write code var as comm_var

 

}

return 0;

}

 

Hope this will help.