I'm using Neoload 8.0.2 and I want to write a variable extracted from response in an external .txt file. For that I am using Neoload's JavaScript Action and I have written the following code snippet:
var file = java.io.File("C:\\filename.txt");
var writer = new java.io.FileWriter(file,true);
var var1 = context.variableManager.getValue("extVar");
writer.write(var1 + "\n");
writer.close();
I am not getting any errors in Neoload but file is not being created and if I create a file in the mentioned path myself the extvar (extracted variable) don't gets written on it. Is there something wrong with this script or do I need to install any . jar classes in Neoload? Or does java.io.file is pre-installed in Neoload?
Any guidance will he helpful.