Unanswered question

options for using javascript in neoload

is it possible to have neoload perform any function that can be written in javascript? specifically I want to use javascript that is invoked by neoload to create a file with a specific content on the server it is running from. is this possible?

Martin S.
Martin S.

Martin S.

Level
0
54 / 100
points

Answers

Nouredine A.
Nouredine A.

Nouredine A.

Level
4
5000 / 5000
points
Team

You can create function in NeoLoad javascript to create a file on your load generator machine. You have many examples in the community. For example, you can check that post

Martin S.
Martin S.

Martin S.

Level
0
54 / 100
points

thank you for the information Nouredine, unfortunately I have no experience with javascript. I originally wanted to use the command line for this task but because the command line changes certain values im giving this a try.

can you give me a little more information on where this would be found and modified/set?
"Note: if you use it inside the JS librairie, copy all the code inside the function otherwise the compilation won't work. If you use all the code inside a NeoLoad JS you can leave it as is. "

I want to create this .txt file prior to kicking off the load test actually. also, for this to run will it need a population added to it if it is in its own user path? I apologize for the additional questions. thanks again for all your help!

p.s. is there a way to respond to an answer outside of the "answer this question" button? my eyes seem to be failing me today as im not seeing anything...

Nouredine A.
Nouredine A.

Nouredine A.

Level
4
5000 / 5000
points
Team

You can use the JS example as is. Drag and drop the JS under the Actions container and copy paste the JS in the example.

Modify the path used in the example (c:\\log.txt) to suit your need.

Then use writeFile(cpt+";was the value from my test"); to use the function and store the text you would like.

Regarding your other question, you can use a virtual user inside a populaton and then create other population for your other scripts. You can configure the population to run sequentially. The second population can start when your first population is completed.

That should suit your need.

You can only use the "answer this question" button.