We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
4.35.0
Here is the script I want to add in my login request:
pm.collectionVariables.set("token", pm.response.json().data.token);
But not sure how to add the post-response script to the login request.
'postman' => [ 'enabled' => true, 'overrides' => [ // 'info.version' => '2.0.0', 'info.name' => 'Example API', 'info.description' => 'API documentation for the Example API.', 'variables' => [ [ "key"=> "baseUrl", "value"=>"http://xyz_site.test", "type"=>"string" ], [ "key"=>"token", "value"=> null, "type"=>"string" ], [ "key"=>"password", "value"=>"12345678", "type"=>"string" ], [ "key"=>"email_user", "value"=>"[email protected]", "type"=>"string" ] ], "auth" => [ "type" => "bearer", "bearer" => [ "key" => "token", "value" => "{{token}}", "type" => "string" ] ] ], ],
Following is the post-response script example snippet from the postman collection export:
{ "item": [ { "name": "Authentication", "item": [ { "name": "Login User", "event": [ { "listen": "test", "script": { "exec": [ "pm.collectionVariables.set(\"token\", pm.response.json().data.token);" ], "type": "text/javascript", "packages": {} } }, { "listen": "prerequest", "script": { "exec": [ "" ], "type": "text/javascript", "packages": {} } } ], "request": { "auth": { "type": "noauth" }, "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json" }, { "key": "Accept", "value": "application/json" } ], "body": { "mode": "raw", "raw": "{\"email\":\"{{email_admin}}\",\"password\":\"12345678\"}" }, "url": { "raw": "{{baseUrl}}/api/login", "host": [ "{{baseUrl}}" ], "path": [ "api", "login" ] } }, "response": [] } ] }, ] }
The text was updated successfully, but these errors were encountered:
I have no idea. Where is the script meant to be specified in the Postman collection file format? Doesn't the overrides section work?
Sorry, something went wrong.
No branches or pull requests
Scribe version
4.35.0
Your question
How to override post-response script content for the postman?
Here is the script I want to add in my login request:
Following is the variables I've already overridden successfully:
But not sure how to add the post-response script to the login request.
Following is the post-response script example snippet from the postman collection export:
Docs
The text was updated successfully, but these errors were encountered: