Showing results for 
Show  only  | Search instead for 
Did you mean: 

Integration with TruClient



We've been able to integrate Browser Agent with HP QTP and Selenium. We set up custom timers by calling the JavaScript function  _dt_setTimerName(). But this function does not seem to work with HP TruClient, which is a Java Application and works pretty similar to QTP and Selenium. Wondering if there is a plan to integrate with TruClient?




Dynatrace Leader
Dynatrace Leader

Is there no option in Load Runner to execute JavaScript in the application you are testing via TruClient?

The TruClient is compatible with DT JS. We've tried server-side tagging and it works


However, for client side tag, _dt_setTimerName("Login") won't work. Tried single quotes, double quotes. 

Not sure whether it is a configuration issue or incompatibility with TruClient?

Dynatrace Leader
Dynatrace Leader

Well - I am not an expert in TruClient. Maybe it makes sense to ask this question on the HP Forums to see whether anybody knows how to inject JavaScript calls in your Truclient script. There is nothing we can do to extend the featureset of LoadRunner


Tthe function Utils.addAutoHeader() may not be the dynatrace function. This looks more like a generic function to add fields in header.

_dt_setTimerName() is more specific method for dynatrace.

Having said that I think the compatibility is not an issue because we get the javascipt function details when using browser agent with TrueClient. And DT instruments the .js files using two functions _dt_methodEnter() and _dt_methodExit() these methods are working.



yes, Utils.addAutoHeader()  is a TruClient function, with the help of that we are injecting DT tags with every web request.

"Is there no option in Load Runner to execute JavaScript in the application you are testing via TruClient?"

Yes, HP LoadRunner TruClient protocol allows evaulation/execution of JavaScript and C code.  Calling the _dt_setTimerName() method within JavaScript results in "failed - exception occurred: ReferenceError: _dt_setTimerName is not defined". 

I've exploded the DynaTrace XPI (dtffagent.xpi) and found it includes a few JS files and redundant DLL's for different versions of FireFox.  At closer look I noticed _dt_setTimerName is referenced within the DLL's; not defined in any JS files.  Going with the asumption that the DLL is a .NET or C++ binary I assume can be accesed using the js-ctypes library to open the DLL and call the _dt_setTimerName method.  I've started to put that together but I'm not familure with js-ctypes.

JS Code so far:

var dtlib ="dtffagent_31000.dll");   /* Compatible with the headless vesion of mozilla used in TruClient */
setTimerName = dtlib.declare("_dt_setTimerName",   /* function name */
var err = setTimerName('Login');

But get an error "couldn't find function symbol in library". 

Let me know if I'm chasing my tail with ctypes. 

Newcomer kick me for trying this the hard way (smile)  I'm leaving the above in the event someone wants to load other DLL's in TruClient.  I realize now that the DLL may have been a compiled bunch of JS files.  But I digress. 

I got it working and tested it with Amardeep (above). 

For TruClient to access the method it needs to access it through the Window object:


Meng, I shared what I did with Conner.  He mentioned writing it up to share with the greater community. 

Note: I tried the window object before but I'm assuming the dT agent may have been off and the method wasn't exposed

Thank you very much, Eric!


You're welcome.  I was unaware of the issue till our conference call yesterday.  Next we need to tackle turning the agent on/off and configuring it from TruClient.