Unanswered question

Unable to use an extracted variable?

I have added correlation to a Websocket script to pull back all matching occurrences of a variable called alarms). When the script runs, I get multiple successful extracted variables – e.g. alarms_matchNR, Alarms_rand, alarms_1, alarms_2, etc. Furthermore, as it the websockets protocol I get multiple alarm responses across multiple channels. So, I may get several responses for alarm_rand or alarms_1, alarms_2, etc which all contain different values.

The problem is when I try to use the extracted variables in a URL either as ${alarms_n} or even as ${alarms_1, etc}, later on the script , it fails.

Neoload literally passes it as alarm_n but does not pass the captured variable. I’ve used variable picker to select the alarms_n. Interestingly, Alarms_rand passes OK but not alarms_n.

What am I missing that is stopping me from using the extracted value as alarms_n?

Hope this makes sense

screenshots in attachment.

Ajaz Z.
Ajaz Z.

Ajaz Z.

Level
0
19 / 100
points

Answers

Neil W.
Neil W.

Neil W.

Level
4
5000 / 5000
points
Team

alarms_n is a placeholder, the n represents a number (an item from the list), it has to be alarms_1 or _2 or _3. alarms_rand works as rand is a random item from the captured list

Why alarms_1 fails is another question

Francis L.
Francis L.

Francis L.

Level
0
13 / 100
points

Hi Ajaz, if you want to use variable of variable in your script, simply use command :

context.variableManager.getValue(alarm_n) without "". In this case, variable is really use.