@singhsivcan@cdxcz Similarly I have one requirement, would like to understand who I move ahead with Postman.
1.Select the GET Method.
2. Enter the End point http://dummy.restapiexample.com/api/v1/employees URL.
3. Click on send button and get the response.
4. Observe the response.
5. Verify the response body through test script and data driven approach(.csv file)
Who I can verify those data through script, Yes I know one by one I can verify it.
but wanted to make script more generic.
Like put some data into variable, Put same variable and values into .csv file, run the collection run and verify the response.
@aakashjain8693 You cannot read a CSV file from the test script unfortunately within the Postman app.
You might need to use newman to achieve something like this which is our CLI tool and also can be integrated in node.
I am sure @danny-dainton has some ideas around a solution for this kind of problem.
What if I have a payload like this set in the globals file:
[{āxā:āabcā,āyā:āefgā,āzā:āhijā}]
But letās say I want to only access āyā value inside a JSON RAW Body?
Is that possible? I looked at solutions to escape the āā but Iām struggling.
Iāve been reading up for the past 3 days and trying out all sorts of suggestions and pieces of code shared here but canāt seem to get things to work as I want. The last I tried was @Sandokhan 's example of ācitiesā.
I would appreciate anyoneās feedback here.
I am requesting the azure devops service to get a list of projects in our organization and want to re-use the project names in the response in a next request where I need the names to get a another list of what really want to have.
pm.collectionVariables.set() and pm.collectionVariables.get() seem the way to go, but Iām missing something Iām sure.
If thereās an example out there Iāve missed let me know please.
Thanks a lot for any pointers, Iām totally new at this. I did manage to get out nice lists and formatted them in tabular output with the visualization, very nice.
Thank you for the response.
I actually want to save all the (135) project names and use each one in the next request: https://dev.azure.com/{{organization}}/{{project}}/_apis/distributedtask/queues?api-version=6.0-preview.1
I donāt know if thatās possible though? The request has only a place for one {{project}} (name) and I wouldnāt know how this would be able to create on output result for all project names.
I have been trying to develop a piece of code to store the post request output(in json format) in an array and compare the array output with a value to see if it matches my condition.
{
āCE:get_versionā: {
āreturn_codeā: 0,
āmessageā: āDONEā,
āelapseā: 78
},
āCE:get_statusā: {
āreturn_codeā: 0,
āmessageā: āDONEā,
āelapseā: 390
}
}
check that all āreturn_codeā entries are set to 0.
Beware that the number of entries is dynamic and can vary in time, do not assume a fixed content (e.g below answer shows two entries CE:get_version and CE:get_status, but the project will incrementally add some with new names over time without altering the monitoring scenario).
In case any of the return_code is != 0, trigger an error message that includes the full json answer.
Could you please suggest on this. Thanks in advance.