Hello Maam/Sir.
Absolute newbie for Postman.
I’m currently having an issue on reading datadriven values that are enclosed in double quotations using csv file. Sample datadriven in csv file:
pageNumber
“2”
“3”
I already declared variables in local environment, in the endpoint and in the Params
And here’s my javascript code for reading the data. I tried to use the .slice function to remove the double quotes when reading the values in the csv file.
parameters = [‘pageNumber’]
for (i=0; i<parameters.length; i++)
{
readValueInCSV = pm.iterationData.get(parameters[i]);
console.log ("Value of pageNumber: " + readValueInCSV);
temp = readValueInCSV;
temp = temp.slice(1, temp.length-1);
console.log ("Value of pageNumber after slice: " + temp);
pm.environment.set(parameters[i], temp)
}
After running the datadriven, the double quotations were actually removed in the local environment. Please see screenshot below:
However, based on the results the endpoint fetched, there were still characters displayed. See screenshot below (these diamonds with question marks).
My point is… I want to read datas enclosed in double quotation marks and store them in local environment variables that can be passed to the Params and using only GET Method.
My expected endpoints displayed should be like these:
GET https://reqres.in/api/users?page=2
GET https://reqres.in/api/users?page=3
instead of:
GET https://reqres.in/api/users?page=�2�
GET https://reqres.in/api/users?page=�3�









