Having trouble with those new TruClient Functions? Here’s why

LoadRunner 11 has added the AJAX Truclient protocol, and with it new functions for it that are unlike the old C-based functions. As of this writing, there still isn’t an entry in the function reference for the protocol with examples of usage, but only documentation found in the help documentation.

However, recently we found that some of these functions are not correct. HP recently added a new knowledge base article address this:
KM1025315

Problem: When trying to use the following functions in an step “Evaluate JS”:

LRAPI.userDataPoint
UtilsAPI.clearCookies
UtilsAPI.clearCache

the following error message appears:

“Evaluate JS UtilsAPI.clearCookies (or clearCache) ** failed – an argument is invalid: ‘Code”:JavaScript exception ‘ReferenceError: UtilsAPI is not defined’ during evaluation”.

Cause: The correct API prefixes are LR and Utils.

Fix:

Use the prefixes LR and Utils instead of LRAPI and UtilsAPI:
LR.userDataPoint()
Utils.clearCookies()
Utils.clearCache()

This pretty much amounts to an “oops”, but at least they found it. If you need to use this functionality, make sure to make a note of these corrections.

What's Next?

Did you enjoy this article? Help spread the word by sharing:

Join the Northway Navigator Club today and get access to restricted content including our best tips and tricks. Membership is free! You will also receive free email updates by registering.

Engage in the conversation and leave a comment:

Scott Moore

About Scott Moore (153 articles)

With over 20 years of IT experience with various platforms and technologies, Scott has tested some of the largest applications and infrastructures in the world. He is a Certified Instructor and Certified Product Consultant in HP’s LoadRunner and Performance Center products. He currently holds HP certifications for ASE, ASC, and CI. A thought leader in the APM space, he speaks regularly at IT conferences and events



  • Tapan

    using the correct funcations we are not getting any errors, but its not working for us.
    we are getting the same user logged in again.. indtead we need a fresh login page. :(