Unanswered question

How to Extract and Save the value in File as txt or csv

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?

venkata S.
venkata S.

venkata S.

Level
0
39 / 100
points

Answers

John S.
John S.

John S.

Level
0
36 / 100
points

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.

Aditya R.
Aditya R.

Aditya R.

Level
0
29 / 100
points

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();
}