Unanswered question

Regarding writing virtual user id and load generator name into a text file during load test

I am doing a neoload webservice scripting and as part of that I need to write the load generator name, VUser id,current iteration and a RoomCategoryCount(from the response) to a log file.
For that I wrote below script, but it is working only for single virtual user not in a load test.
I couldn't understand what is the issue behind this could you please help?

//this code is in script file of the neoload
var varRoomCategoryCount = context.variableManager.getValue("RoomCategory_Res_matchNr");
sContext = context.currentLG.name + ";" + context.currentVU.id + ";" + context.currentVU.getCurrentIteration() + ";" + varRoomCategoryCount;
writeFile(text);

//Below code in js libaray file in Edit menu of neoload

var lock = new java.util.concurrent.locks.ReentrantLock();
var date = Date();
function writeFile(text)
{
lock.lock();
var writer = new java.io.FileWriter("H:\\log11.txt",true);
writer.write(text);
writer.write("\r\n");
writer.close();

lock.unlock();
}

Jayakrishnan S.
Jayakrishnan S.

Jayakrishnan S.

Level
0
1 / 100
point

No answers