# Response code fails only when test runs in browser's monitor

**URL:** <https://community.postman.com/t/response-code-fails-only-when-test-runs-in-browsers-monitor/19136>\
**Category:** Help Hub\
**Tags:** monitors, tests, authentication, json\
**Created:** [January 13, 2021, 8:11pm UTC](https://community.postman.com/t/response-code-fails-only-when-test-runs-in-browsers-monitor/19136 "2021-01-13T20:11:36Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![taehoshino](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/taehoshino/32/6608_2.png) [@taehoshino](https://community.postman.com/u/taehoshino)\
**Post date:** [January 14, 2021, 12:26am UTC](https://community.postman.com/t/response-code-fails-only-when-test-runs-in-browsers-monitor/19136/2 "2021-01-14T00:26:18Z")

</div>

Hi @billybolton! Welcome to the community 👋

I understand your tests fail only when you run the collection with Postman Monitor, is that correct?

As Postman Monitor is being executed on the Postman server, there are a few differences to be noted, compared to when you run collections locally - please refer to the thread below for more information.

> [@Monitoring Authorization Error](https://community.postman.com/t/monitoring-authorization-error/18761/3):
>
> Hi @jbalasi! I understand you are using a API key that is set as a global variable when running a monitor, correct? Monitor does not have access to global variables so use collection/environment variables instead. FYI, a few differences between runner and monitor: All API must be publicly available No access to global variables (use collection/environment variables instead) No access to CURRENT VALUE (remember CURRENT VALUE is local to your session) Hope this helps!

Having said that, in your current situation, I wonder if your api keys are stored in CURRENT VALUES of environment - if so, please copy them to INITIAL VALUES so that those values are accessible by the Monitor.

You also mentioned you would like to check the value used for api keys - for this, you can simply include `console.log()` in Test scripts. This will then printed out in the **console log** tab of your Monitor page.

 ![support-image](https://us1.discourse-cdn.com/getpostman/original/3X/f/0/f0d369333de37b292b4c40cb18d43c2b8321db0d.png)

Hope this helps! Please let me know if you have further questions 🙂

---

_[View the full topic](https://community.postman.com/t/response-code-fails-only-when-test-runs-in-browsers-monitor/19136)._
