Unanswered question

How to use Java Script in Neoload

How to use the java script in neoload

Nrusingh P.
Nrusingh P.

Nrusingh P.

Level
0
75 / 100
points

Answers

Christophe M.
Christophe M.

Christophe M.

Level
3
3140 / 5000
points
Team

You need to add a Javascript action to your VU profile:
http://www.neotys.com/documents/doc/neoload/latest/en/htm...

NeoLoad Javascript API is described here:
http://www.neotys.com/documents/doc/neoload/latest/en/htm...

Ramchander D.
Ramchander D.

Ramchander D.

Level
0
24 / 100
points

Add javascript action to virtual script and add your code. For example, I added following code to retrieve load generator hostname, which worked for me:

if (context.currentLG.name==null) {
context.fail("Agent Name not found");
}
context.variableManager.setValue("AgentName", context.currentLG.name);
logger.debug("Agent Name=" + context.variableManager.getValue("AgentName"));