Hey @bj-nicoo
There might be some confusion around what “Pre-request script” is so let me clarify on this first
It works as following order:
pre-request script
→ sending request → Tests
So pr-request script gets executed before the request is sent, so pre-request script does not know what the response would be (or what the response code would be).
I hope this makes sense but please do feel free to reach out if you have further questions