The transport’s journey: How Tricentis LiveCompare protects your SAP systems from defects
Watch to follow an SAP transport as it moves throughout the development lifecycle and see how Tricentis LiveCompare can protect systems from defects.
During your load test, you may want to log information related to your script. This is useful if you want to check data afterward, whether it was used or modified during your load test.
There are a few ways to log data during your tests:
var lock = new java.util.concurrent.locks.ReentrantLock();
var date = context.variableManager.getValue(“CurrentDate”);
context.fail(“Variable ‘CurrentDate’ not found”);
var writer = new java.io.FileWriter(“c:\log.txt”,true);
Pre-requisite: “CurrentDate” is a NeoLoad variable (see Variable manager, create it) that will display the current date. It’s optional and can be replaced with any variable needed.
var cpt = context.variableManager.getValue(“StringNameFooBar”);
context.fail(“Variable ‘StringRandom’ not found”);
writeFile(cpt+”;was the value from my test”);
Note: “StringRandom” is a Neoload variable; it’s optional and can be replaced with any other variable needed.
In NeoLoad, it is possible to write content to a file from the GUI interface of a specific response given during playback or test. The Response storage checkbox makes it possible to save the content of the response in a .bin file. This function stores the content of the response on the machine executing the virtual users to check it externally. Here’s how:
The goal of this technique is to capture an extraction and write this value to a file. NeoLoad has an advanced action, under the “Launchers” section, called “command line.”
Combine this technique with a shell script to better enhance the data manipulation should you need to. To use the command line, drag the action into your User Path, and add the required parameters. As you can see in the figure below, I’m calling the shell script and then pushing data from the extraction (variable) that I’m getting from the response.
Here is the simple shell script that is being called:
echo $1 >>/Users/neotys/Desktop/nl_text.txt
[H2] Next steps: Review documentation or talk to us
Check out all of the content included within NeoLoad documentation.
Want to discuss further, contact support.