bruno
bruno copied to clipboard
Post Response Script environment variable
I'm trying to migrate from postman to bruno and I need some for the post response script
I'm using the bruno desktop UI with this code
bru.setVar("accessToken", res.body.payload["access_token"]);
I don't really know if res.body.payload["access_token"] is the correct way to access my response but before that I notice that even doing something as easy as
bru.setVar("accessToken", "abc");
do not work at all... (and I don't know why) In my environment I already got my accessToken variable empty, and it stay empty (even in the file if I try to open it so it is not an interface visualization error). I also tried with var tab (that I don't think I will need since I'm trying to set the variable on the enviroment) but it still will not work (the variable on the var tab stay empty).
I already notice that I cannot import postman environment (at least bruno give me an error when I try, if you know a way please tell me that also) so if this is not working I will have to continue with ARC for now (even if not supported anymore... and I already like bruno since it can import from postman collection without any problem unlike ARC).