I previously worked on LoadRunner and I find scripting in Neoload to be a great pain. Also I am not that good in coding with JavaScript.
I am just trying to capture a stack variable (name) using Neoload tool.
Ex. name_1, name_2, name_3, name_4
So I need to randomize and choose from 4 of the above.
Lets say, name_${randInt}. I'm ok till this.
Now, I need to check the value for this variable, Say for ex. name_${randInt} has the value 'Checked'. Now this is what I need.
If name_${randInt} = 'Checked', myVar = on; else myVar = off
And this myVar is fed back to my script.
Might sound simple but how can this be done with Javascript using Neoload?
Sample code is given below,
var check = context.variableManager.getValue("ERRP_CheckUnCheck");
if (check==null)
{
computedValue = 'on'
}
else
{
computedValue = null
}
context.variableManager.setValue("computedVar1",computedValue);