I am using NeoLoad 5.0, I have successfully extracted value from a response using Variable extractor. Now I want to store this extracted value into .txt or .csv.
Please provide the steps how to do?
I'd like to provide the correct answer. But I can only suggest doing what I've done which is to use javascript to write to the log file and then grep + awk + sed and so on to extract the values from the log file and use them to create a csv file. I know it's not the right way to do things, but I've not yet found a better way.
Use this in JavaScript, next Step where you extract data:
var myVar = context.variableManager.getValue("EXTRACTED VARIABLE NAME");
if (myVar==null) {
context.fail("Variable 'myVar' not found");
}
writeFile(myVar);
function writeFile(text)
{
var writer = new java.io.FileWriter("O/P .CSV LOCATION",true);
writer.write(text);
writer.write("\r\n");
writer.close();
}