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

TruClient error handling

Esteemed Contributor [Founder]

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.

12 REPLIES
HPE Expert

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.

HPE Expert

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
Network Virtualization PM
Esteemed Contributor [Founder]

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

HPE Expert

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
Network Virtualization PM
Esteemed Contributor [Founder]

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.

HPE Expert

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
Network Virtualization PM
Esteemed Contributor [Founder]

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.

HPE Expert

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

Esteemed Contributor [Founder]

Re: TruClient error handling

OK - glad to hear it. Thanks, Shlomi!

Highlighted
Regular Visitor

Re: TruClient error handling

Shlomi, Is there an expected release date for this?

Rajeshwar
HPE Expert

Re: TruClient error handling

Hi,

We can't commit publicly for features deliveries time.

Sorry.

Guy Rosenthal
Network Virtualization PM
Valued Contributor

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!