From server response, I have captured all occurance of Dates in a variable "NL_ExtractArray" Since it has 100 values.
now, I have to access all the content of "NL_ExtractArray" in JavaScript code & find the latest date.
Could you please help me with the example.
Note:
I am able to access one values at a time using "NL_ExtractArray_1".
But not success, while using array and loop function .
JavaScrit Code:
var NLArrayLength = context.variableManager.getValue("C_EffectiveDate_matchNr");
var JSDateArray;
var index;
for ( index=0; index<=NLArrayLength; index++) {
context.variableManager.setValue("JSDateArray_"+index,context.variableManager.getValue("C_EffectiveDate"+index));
logger.debug("ComputedValue_Index="+index);
logger.debug("ComputedValue="+JSDateArray);
}
Neoload Output sample
2021/03/24 13:33:44 DEBUG - neoload.JavaScript.script_2: ComputedValue_Index=0
2021/03/24 13:33:44 DEBUG - neoload.JavaScript.script_2: ComputedValue=undefined
2021/03/24 13:33:44 DEBUG - neoload.JavaScript.script_2: ComputedValue_Index=1
2021/03/24 13:33:44 DEBUG - neoload.JavaScript.script_2: ComputedValue=undefined
2021/03/24 13:33:44 DEBUG - neoload.JavaScript.script_2: ComputedValue_Index=2
2021/03/24 13:33:44 DEBUG - neoload.JavaScript.script_2: ComputedValue=undefined
2021/03/24 13:33:44 DEBUG - neoload.JavaScript.script_2: ComputedValue_Index=3
2021/03/24 13:33:44 DEBUG - neoload.JavaScript.script_2: ComputedValue=undefined