Questions tagged [postman-pre-request-script]

Use this tag for issues with pre-request scripts in postman, use the "postman" tag for general issues

Reference:

319 questions
-1
votes
2 answers

how get this specific format of date in pre-request of postman

I have this in c#: var date = DateTime.UtcNow.ToString("R", CultureInfo.InvariantCulture); and the result is like this: date = "Tue, 27 Dec 2022 13:30:35 GMT"; I want to have this result in pre-request of postman to pass this variable as date. But…
-1
votes
1 answer

How to pass global variables to JSON object for validation in Javascript

Hello I am now to javascript and writing script for API testing in Postman to automate my usecases. Need help for below query. Lets say i have my API request as below. API request: https://reqres.in/api/users/2 Response: { "data":{ …
-1
votes
1 answer

Postman giving 400 for pm.sendRequest

When I am running below send request from Postman - Tests, getting 400 bad request. Could anyone tell me where I am wrong in sending the request? let loginRequest = { url: new_url, method: 'POST', headers: { …
-4
votes
1 answer

unable to access json response in postman pre requisite script

In pre requesite script ,send a request and it is giving 200 status code and res.json() used but it is showing undefined I tried var r =res.json() console.log(r) but it is giving undefined
1 2 3
21
22