Storing the Error transaction(if parameter causes transaction to fail) into a File (276 Views)
Reply
Advisor
remo1259
Posts: 16
Registered: ‎06-29-2012
Message 1 of 4 (276 Views)

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

HP Expert
Suerte13cr
Posts: 736
Registered: ‎09-14-2011
Message 2 of 4 (252 Views)

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
xtom
Posts: 55
Registered: ‎06-06-2012
Message 3 of 4 (248 Views)

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
Ajay_U
Posts: 108
Registered: ‎04-30-2012
Message 4 of 4 (240 Views)

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.

The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.