Re: TruClient error handling (1515 Views)
Reply
Esteemed Contributor
Posts: 544
Registered: ‎06-05-2008
Message 1 of 13 (1,559 Views)

TruClient error handling

Unless I am missing something that is right in my face, there is no way I can trap an error message on a page and then fail a transaction.

 

In the HTTP world, I would very simply:

web_global_verification("Text/IC=An unexpected error has occurred.","Fail=Found","ID=unexpected error", LAST);

 

 

If someone can show me how I am being an idiot, please do so.

HP Expert
Posts: 120
Registered: ‎08-15-2009
Message 2 of 13 (1,515 Views)

Re: TruClient error handling

You are correct. There is no way to do so. 

 

I suggest you open an enhancement request. We realize this is very useful functionality, by opening an enhancement request you will stregthen its' priority.

Visit LoadRunner Linked-In Group: http://www.linkedin.com/groups?about=&gid=1879289

Visit TruClient Linked-In Group: http://www.linkedin.com/groups/HP-TruClient-Software-group-4539324/about
HP Expert
Posts: 280
Registered: ‎10-24-2011
Message 3 of 13 (1,490 Views)

Re: TruClient error handling

Hi,

If you are willing to verify some object (not at the transport level) on a page you can use the If Verify or If Exist steps and you can use the JS API for transactions in which you have the option to write LR.EndTransaction("trans_name", FAIL).

 

Is this is what you are seeking for? Which LR version you are using?

Guy Rosenthal
TruClient RnD Team Manager
LoadRunner RnD
Esteemed Contributor
Posts: 544
Registered: ‎06-05-2008
Message 4 of 13 (1,444 Views)

Re: TruClient error handling

I'm not willing to put unique verification steps before every single step in my script, just to catch the same error.

 

LR/PC 11.52

HP Expert
Posts: 280
Registered: ‎10-24-2011
Message 5 of 13 (1,432 Views)

Re: TruClient error handling

OK then.

If the error is in the page level (not transport) you can use Event Handlers (on a step's scope) and than execute a specific function (let's say ending a transaction with FAIL status).

 

Hope it is clearer.

 

Guy Rosenthal
TruClient RnD Team Manager
LoadRunner RnD
Esteemed Contributor
Posts: 544
Registered: ‎06-05-2008
Message 6 of 13 (1,387 Views)

Re: TruClient error handling

Yep. Call a C library to handle the transaction. I was thinking there would be inherent TruClient transaction error handling, but I see that is not a strong area in this protocol. OK - thanks.

HP Expert
Posts: 280
Registered: ‎10-24-2011
Message 7 of 13 (1,376 Views)

Re: TruClient error handling

Actually you don't need to call C library. You can use JS API TruClient provide.

Just drag Evaluate JS step and use the LR.startTransaction and LR.endTransaction functions wherever you'd like.

Guy Rosenthal
TruClient RnD Team Manager
LoadRunner RnD
Esteemed Contributor
Posts: 544
Registered: ‎06-05-2008
Message 8 of 13 (1,349 Views)

Re: TruClient error handling

I don't think you are quite grasping what is missing here.

 

In the HTTP protocol, we have the concept of a global verification step. From a single error trap, we can set ANY open transaction to FAIL.

Now, in TruClient, we do have a global Event Handler. But in order to fail the containing transaction, you have to know the transaction name (lr.end_transaction "GetStocks", lr.FAIL). What is missing is the ability to set ANY open transaction to FAIL.

 

I have tried to circumvent this with a C library:

 

  void FailTransaction()
 {
 lr_fail_trans_with_error("Error."); 
 lr_vuser_status_message("Error on user%s."lr_eval_string"{Vuser}"));
 }

However, the transaction information is evidently not passed from TruClient to VuGen, so this does not work.


So I still have no way to error trap and fail transactions on a global scale.

HP Expert
Posts: 120
Registered: ‎08-15-2009
Message 9 of 13 (1,341 Views)

Re: TruClient error handling

Hi James,

 

The requirement is quite clear. TruClient should provide the same capability Web Http has. 

 

Provide API for global verification point. Once the criteria is not met, any open transaction should report fail status automatically without adding additional logic to the code.

 

We already added this requirement to our backlog. 

 

Best Regards,

Shlomi

Visit LoadRunner Linked-In Group: http://www.linkedin.com/groups?about=&gid=1879289

Visit TruClient Linked-In Group: http://www.linkedin.com/groups/HP-TruClient-Software-group-4539324/about
Esteemed Contributor
Posts: 544
Registered: ‎06-05-2008
Message 10 of 13 (1,335 Views)

Re: TruClient error handling

OK - glad to hear it. Thanks, Shlomi!

Visitor
Posts: 4
Registered: ‎12-10-2013
Message 11 of 13 (1,114 Views)

Re: TruClient error handling

Shlomi, Is there an expected release date for this?

Rajeshwar
HP Expert
Posts: 280
Registered: ‎10-24-2011
Message 12 of 13 (1,106 Views)

Re: TruClient error handling

Hi,

We can't commit publicly for features deliveries time.

Sorry.

Guy Rosenthal
TruClient RnD Team Manager
LoadRunner RnD
Valued Contributor
Posts: 92
Registered: ‎07-16-2010
Message 13 of 13 (871 Views)

Re: TruClient error handling

Adding this comment to bump the vote and attempt to expedite the long time due solution.

 

Are there any workarounds or recommended best practices to carry out the same ? Its also critical to get some data used by script for that failure points and adding verify for each step will be a overkill for performance testing perspective. This isn't a functional validation in the sense where time trade-offs are done for accuracy. If we add verify for each step then achieving target rates for hits or transactions per unit time will be challenging as each script will be slow due to spending lot of time in verification itself.

 

Everyone one wants that catch and finally blocks sooner if they want to use this technology in more robust way for performance.

 

Thanks!

 

 

 

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.