Questions tagged [postman-testcase]

283 questions
0
votes
1 answer

Automation in Postman - Different set of input datasets

Suppose my input body is the below in JSON format [ { "username": "Test User 1", "rollNo": 45 }, { "username": "Test User 2", "rollNo": 46, "hometown": "XYZ" }, { "username": "Test…
0
votes
1 answer

Postman if/else condition not working properly

This code is not working as expected when running collection and used as a test script on the first request: when console.log gives output null, the collection doesn't stop, when it should. function never goes to the 'else' condition, even when I…
0
votes
1 answer

How can I JSON.parse request body correctly in postman

My goal is to set environment variable from responseBody so I could reuse it later on in other requests. Before I do that I want to first fetch that variable, however I encounter issues. So my responseBody looks…
Aleksandre Bregadze
  • 199
  • 1
  • 3
  • 14
0
votes
1 answer

Can I skip some of the selected "Api Requests" in postman while using it through Newman-Runner-CLI?

As a user, I have several API collections created using postman and now I've integrated the Newman-Runner-CLI. My question is that, is there any way to skip some of the selected API Requests from each collection, or is there is any way to add…
0
votes
0 answers

Test item count in the XML response after converting to JSON

I have the following XML output that has two packages in the items block. I want to write a test to check that the response item block has package count 2. Wrote below test using length function, it works fine when executing the request as an…
0
votes
0 answers

Postman. Set variables for array

I can't seem to make my code work. Could please anyone explain what am I doing wrong. Thank you! var jsonData = JSON.parse(responseBody); pm.collectionVariables.set("building_ref_id", jsonData.included[1].attributes.building_ref_id); "included": [ …
0
votes
0 answers

Is there any way to sending different cases for one endpoint intead of CSV or any data file in Postman?

This my Pre-request script in Postman: var requestToRun; switch (data["Condition"]) { case (1): requestToRun = [{ "test": "yusuf-klmn", "imageUrl": "", "name":"lop-kjm", "test2":…
0
votes
1 answer

Postman - how to run requests in different iterations

I have an issue about running a collection I have the following: Collection: Request 1 Request 2 Request 3 What I want: When I run collection, I want Request 1 to be executed 20 times, then after iteration 20 to run Request 2 and after Request 2 is…
0
votes
1 answer

How to pass postman parameters for [From body] List toolId

I need to test post method but how to send postman parameters for [From body] List toolId , I need to check the method but using list with formbody I am not able to send the response
Ayaan
  • 1
  • 2
0
votes
0 answers

ReferenceError: list is not defined Potsman error

I am executing below script in Postman and getting error "ReferenceError: list is not defined " response = pm.response.json(responseBody) console.log(response) token = response.provider-list[6].user-list[1].activation-token console.log(token) I am…
0
votes
1 answer

I am finding difficult to do assertion on the below API response

[{ "FP": "DAV1", "SMO": false, "SP": [{ "name": "FOP1", "Exam": [{ "Marksguid": "a02dac4f-630f-4ed0-aa54-8c7044b71f2f", "apiUrl": "test1", "interval": 65, "schemaVersion":…
0
votes
2 answers

Unit Test to find a keyword in a response array

good day everyone, i am new here, I have a response data looking like this [ { "Outlet": "Outlet1", "Inventory": 12 }, { "Outlet": "Outlet2", "Inventory": 0 }, { "Outlet": "Outlet3", …
0
votes
1 answer

Can not check the JSON value from the response body

I just started testing the api using the postman. I have come across one problem with the json path.. in json file I have code which looks like this { "users": [ { "firstName": "UserOne", "lastName": "One", "subjectId": 1, …
sarthok
  • 1
  • 3
0
votes
1 answer

how to assert a string with variable iD in postman

{ "data": { "notifications": [ { "deeplink": "/users/1628507341", "viewed": false } ] }, "status": "success" } how do I write Postman tests to verify the deeplink…
Fayas Hussain
  • 69
  • 1
  • 7
0
votes
1 answer

How to have multi-flow for automated testing in postman?

As mentioned in the title, How to have multi-flow for automated testing in postman? For example, I have these end-points: Create a user Delete a user Create a post (needs a user) I need automated tests like: Flow 1: Create a user > Delete a…
Hamidreza
  • 1,825
  • 4
  • 29
  • 40