Highlighted
Absent Member.. Absent Member..
Absent Member..
5680 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
Highlighted
Absent Member.. Absent Member..
Absent Member..

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
Highlighted
Visitor.

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

0 Likes
Highlighted
Outstanding Contributor.
Outstanding Contributor.

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
Highlighted
Contributor.
Contributor.

Hi @Edo Nir  

I am facing a similar issue. When using a catch block, VUGen wont fail / close the open transaction even if the step(s) within the transaction have already failed. This transaction had started but never got a chance to reach TC.endTransaction.
 
Protocol - Tru client web
VUGen version - 12.6
Application - Salesforce Lightning 
Runtime setting - Simulate new user on each iteration is Disabled since we log in only once and not on each iteration.
 
The structure of the script is as below:
  • Init - Login to Salesforce. Close open tabs if any and landup on Dashboard page.
  • Action - Two blocks
    • 1. Mainflow - User navigates from Dashboard to other pages and completes the intended user journey. The end state should be user is back on Dashboard (similar to Init).
    • 2. Catch block to capture any error occured in the Mainflow and handle it.
      • The catch block includes logging out of the application and then logging back into the application; followed by closing any open tabs leftover in previous steps. The end state should be user is back on Dashboard (similar to Init).
  • End - Log out
Problem statement: Whenever the user encounters any error, the control moves to catch block. Now, the step that failed is part of a transaction which has already started but its TC.endTransaction is not yet reached. Problem is that this transaction is left open (it is not failed automatically unlike web http html, not sure why?). When the next iteration starts (post catch block) and we reach the same transaction start, it doesnt start the transaction saying the transaction is already started and then fails it when transaction ends citing the error that we got in previous iteration and few more errors which are unrelated to the actual failure. Note that this time the transaction had actually passed but the open transaction from previous iteration causes this mess. 
 
Workaround: I had to add a global variable at start of the script. Then, I have to change the value of the variable to the current transaction name everytime a new transaction is started. This way, if an error occurs and control moves to the catch block, the first thing I do is fail the open transaction. Earlier, the challenge was that I didnt know the transaction name as the error could occur anywhere in the script; but now with the global variable, I know the transaction name and I can fail the open transaction before moving ahead in the catch block.
 
I wanted to know if there is an easier way to get the current open transaction name in tru client web, without having to use this global variables. Thanks!
0 Likes
Highlighted
Trusted Contributor.. Trusted Contributor..
Trusted Contributor..

Hi @nikhil,
I have two solutions. The first as described is a handler which calls a handler-function() to clear up my staff. Works fine, but returns to the place where my script stepped into the errorsituation.
The second one is to add a Exit(Action) with status Fail which ends all running transactions.
Hope that helps
0 Likes
Highlighted
Contributor.
Contributor.

Hi @PascalCalovini ,

I have tried using the exit function with Fail status, but unfortunately it doesnt fail the open transaction.

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.