Highlighted
Frequent Contributor.
Frequent Contributor.
493 views

TrueClient Web - TransactionDuration

I am having an issue getting TransactionDuration to return a value. I have tried multiple revisions but all seem to return an undefined value. What I am trying to do is log a custom transaction using setTransaction with the duration of the the surrounding transaction. I have tried it with the transaction with the below code inside and outside the surrounding transaction but all result in an udefined value. Has anyone successfully got this to work.

var nDuration= TC.transactionDuration("OPSMWBS");

0 Likes
5 Replies
Highlighted
Outstanding Contributor.
Outstanding Contributor.

Re: TrueClient Web - TransactionDuration

Hi RickyB,

The TC.transactionDuration API should be used within the transaction (that is, before endTransaction statement).

I know this API had some issues with the Chromium browser, so I'd suggest trying another browser.

Which version and which browser are you using?

 

Edo

0 Likes
Highlighted
Respected Contributor.
Respected Contributor.

Re: TrueClient Web - TransactionDuration

 

Please do not define Manually, Define it in a TruClient Recording Browser 

Let me know if you have any further questions 

0 Likes
Highlighted
Frequent Contributor.
Frequent Contributor.

Re: TrueClient Web - TransactionDuration

Yes, using 12.55 and Chromium I will try with Explorer. Thanks,

0 Likes
Highlighted
Frequent Contributor.
Frequent Contributor.

Re: TrueClient Web - TransactionDuration

I tried it both ways in TureClient recording browser (i.e. used TC to surround with transaction and added transaction manually in Javascrpt (LR.start/end transaction) just to see if it made a difference. But no change. In both cases it was within the outer transaction boundries. Thanks, 

0 Likes
Highlighted
Frequent Contributor.
Frequent Contributor.

Re: TrueClient Web - TransactionDuration

Interestingly, I wrote a c function to do the same and it appears to work. But I would be interested in knowing if anyone is able to get this to work natively in TC.

void reportTransaction()
{
        int iDuration  = lr_get_transaction_duration ("OPSM_GUI_001_07_CLICK_VIEW_BUTTON");
        int iCount     = atoi(lr_eval_string("{ItemCount}"));
        char sCount[40];
        sprintf(sCount,"OPSM_GUI_001_Z0_VIEW_ITEMS_%i",iCount);
        lr_set_transaction(sCount, iDuration, LR_PASS); 
}

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.