I am trying to make a pre-request script for request A that executes another request B for a login function and generating an access token that is saved to a variable but the problem is that for some reason the pre-request script is not executed, the access token remains null and request A will fail due to invalid token error 401.
Request B has basic Authorization in the headers
If I run request B individually it is run successfully and the variable I set gets updated correctly.
This is the script I am using in request A to execute request B
pm.sendRequest("url.example/post", function (err, response) { console.log(response.json()); });
What could be wrong ? Is there any other info i need to provide ?