Answered question

How can i get the available Controller Name and save it into a variable?

i would like to save the controller name from the current Scenario and save that to a custom variable in javascript. Maybe it is possible to get the name of the controller from the current run?

Louis S.
Louis S.

Louis S.

Level
0
7 / 100
points
Neil W.
Neil W.

Neil W.

Level
4
5000 / 5000
points
Team

During a load test, run a single user for 1 iteration on the localhost LG (aka the Controller), this user can run a userpath containing some javascript that gets the hostname and stores it on a shared queue or in a constant variable (see context.CurrentLG.name). One thing to note, the "context.CurrentLG.name" method will return the name or IP that was used when you discovered your load generator. So if you would like to get the hostname make sure to discover your load generators using their hostnames. That includes the local load generator. That said, as you are running the test, you could pass in the hostname as a parameter on the command line using the variables switch

Did you find this useful ?

No (0)

Yes (1)

100%

100% of users found this answer useful

Other answers

christophe M.
christophe M.

christophe M.

Level
4
5000 / 5000
points
Team

I don't think there's a way to retrieve the controller name. Why do you need it?