HPE Software is now Micro Focus
HPE Software is now Micro Focus
LoadRunner and Performance Center
cancel

TruClient: “A model is nice, but show me the code!” Explore the new capabilities

TruClient: “A model is nice, but show me the code!” Explore the new capabilities

hilale

 

mosheK.jpg  This post was written by Moshe Kraus from TruClient, Performance Engineering Core R&D team 

 

 

 

TruClient is an easy-to-use tool for creating scripts that can be used in load testing or in the monitoring of Web applications. 

Unlike other automation tools, which require coding skills, TruClient creates a step-model which is executed in an asynchronous manner and can interact with your application and dynamically respond to it. While not having to write code can be a big advantage and can make script creation much simpler, programmers often want to create their own logic. TruClient does include some control flows in the dynamic model, such as “if” and “for” structures—but these don’t provide much scope for adding complex logic or customized functions to the script.

 

This new ability enables you to select actions in your TruClient script and convert them into working JavaScript code—with just two clicks. After recording the action (and enhancing the model with transactions, control flows, parameter substitution and anything else that can be done in TruClient), just click Convert to Code.

 

By default, object identification is handled by the TruClient engine, and the script refers to test objects by name. However, you can also convert objects into pure code. By doing so, you have full use of the XPath, descriptors, and JavaScript identification (although you’ll no longer be able to use the automatic object identification method). 

TruClient coded scripts run in an asynchronous way on a dedicated thread, and do not block the browser or TruClient’s asynchronous communication with it. 

This is what a simple script looks like, after converting it to code using two different object identification handling methods:


Coded.gif

 

 

 After the initial creation of the coded script, you can change the code as you see fit. 

 

TruClient also supports some debugging capabilities for coded scripts, as shown in the following animated image:Coded2.gif

 

 

So what are you waiting for? Just install the new LoadRunner 12.55 and start coding.

 

Useful tips when working with TruClient coded scripts:

  • When unsure how to do something in TruClient code, do it first in the TruClient model and convert it to code. Then just copy and paste it.
  • To display an object in the replay window, right-click the object name (a line starting with object.tcManaged) or the user managed object (a line starting with "JavaScript""XPath", or "Descriptors"), and select Highlight.
  • Use the autocomplete in the editor to explore the new APIs that TruClient has to offer.

 

You can read more about this amazing new capability in the TruClient Help Center: Convert TruClient Actions to Code. 

Download LoadRunner with 50 Vusers for free here.

 

 

 

  • Load Testing
About the Author

hilale

Comments
New Member.

It is indeed an advanced funtionality for programmers.