saurabh1484
13 years agoContributor
Is there any way to convert string to object?
Hi,
My scenario is like this.
I am reading a row from excel in a variable for a particlau column
row value is like this Username:[Test1,Test2,Test3]
var PropArray= DDT["CurrentDriver"]["Value"](TestCaseName); // PropArray=Username:[Test1,Test2,Test3]
aqString["ListSeparator"] = ":";
var ParamName = aqString["GetListItem"](PropArray,0); // Param Name=Username
var ParamValueArray= aqString["GetListItem"](PropArray,1); // ParamValueArray=[Test1,Test2,Test3]
now if i write
var Length=ParamValueArray["length"] the output is 31 // here it is taken as string hence the output is 31
if i say
var ParamValueArray=[Test1,Test2,Test3]
var Length=ParamValueArray["length"] the output is 3 // here it is treated as array and the output is 3
is there any way if i can string to object?
regards,
Saurabh
My scenario is like this.
I am reading a row from excel in a variable for a particlau column
row value is like this Username:[Test1,Test2,Test3]
var PropArray= DDT["CurrentDriver"]["Value"](TestCaseName); // PropArray=Username:[Test1,Test2,Test3]
aqString["ListSeparator"] = ":";
var ParamName = aqString["GetListItem"](PropArray,0); // Param Name=Username
var ParamValueArray= aqString["GetListItem"](PropArray,1); // ParamValueArray=[Test1,Test2,Test3]
now if i write
var Length=ParamValueArray["length"] the output is 31 // here it is taken as string hence the output is 31
if i say
var ParamValueArray=[Test1,Test2,Test3]
var Length=ParamValueArray["length"] the output is 3 // here it is treated as array and the output is 3
is there any way if i can string to object?
regards,
Saurabh