LoadRunner Practitioners Forum
Showing results for 
Search instead for 
Do you mean 

TruClient - Table Row Example


TruClient - Table Row Example

See attached for instructions and required files.


If you ever needed to work with Tables in TruClient this sample should help.. or at least give you some ideas.


It is more of an advanced level example, but if you have some "DOM" and "JavaScript" experience you should be fine.


There are about 10 different things you can learn from this example:

- custom javascript functions in TruClient.

- calling those functions.

- using DOM XPath function.

- using If/Then blocks.

- using try/catch blocks.

- finding a cell in a table.

- using CONTAINS clause in an XPath.

- using dialogs to display debug messages.

- DOM arrays vs. XPath arrays

- When to use the Arguments section vs. JS-functions.js for your javascript code.

- Toolbox options for custom javascript.


If you have questions/comments/suggestions please let me know.

HPE Expert

Re: TruClient - Table Row Example


Occasional Visitor

Re: TruClient - Table Row Example

Thanks, really helpful.
Esteemed Contributor [Founder]

Re: TruClient - Table Row Example

Love the commentary!

Valued Contributor

Re: TruClient - Table Row Example

[ Edited ]

Thank you! I'd been struggling with how to capture the dynamic text contents of a specific object for use later in the script, and based on what you included here, I was able to put the following fairly generic function together in about 10 min to grab the node object. It actually took me more time to debug my XPath than to write the function, based on your good tutorial. :-)


 * Get text contents of node specified by xPath.
 * @arg     xpath       XPath for requested node.
 * @return              Node element.
function getNodeByXpath(xpath)
    /** Node to be returned. */
    var node;
    // Get node.
    try {
        node = document.evaluate(xpath,document,null,0,null).iterateNext();
    catch (err) {
        return false;
    return node;