Absent Member.. James Leatherma Absent Member..
Absent Member..
4975 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.

0 Likes
17 Replies
Shlomi Nissim Acclaimed Contributor.
Acclaimed Contributor.

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.

0 Likes
Guy_Rosenthal Absent Member.
Absent Member.

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
0 Likes
Absent Member.. James Leatherma Absent Member..
Absent Member..

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

0 Likes
Guy_Rosenthal Absent Member.
Absent Member.

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
0 Likes
Absent Member.. James Leatherma Absent Member..
Absent Member..

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.

0 Likes
Guy_Rosenthal Absent Member.
Absent Member.

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
0 Likes
Absent Member.. James Leatherma Absent Member..
Absent Member..

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.

0 Likes
Shlomi Nissim Acclaimed Contributor.
Acclaimed Contributor.

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

0 Likes
Absent Member.. James Leatherma Absent Member..
Absent Member..

Re: TruClient error handling

OK - glad to hear it. Thanks, Shlomi!

0 Likes
Absent Member.. RManiac Absent Member..
Absent Member..

Re: TruClient error handling

Shlomi, Is there an expected release date for this?

Rajeshwar
0 Likes
Guy_Rosenthal Absent Member.
Absent Member.

Re: TruClient error handling

Hi,

We can't commit publicly for features deliveries time.

Sorry.

Guy Rosenthal
Network Virtualization PM
0 Likes
Absent Member.. ssawale Absent Member..
Absent Member..

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!

 

 

 

0 Likes
perfeng
Visitor.

Re: TruClient error handling

Is there a solution to this proeblem, has the enhancment been implemented?

0 Likes
Edo Nir Outstanding Contributor.
Outstanding Contributor.

Re: TruClient error handling

This is a very old thread and is probably not relevant in current versions.

Please indicate the exact issue you're experiencing and more details (like version and application details) in a new thread.

 

Edo

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.