# Only One test Fail I don't know Why

**URL:** <https://community.postman.com/t/only-one-test-fail-i-dont-know-why/23342>\
**Category:** Help Hub\
**Created:** [May 3, 2021, 3:05pm UTC](https://community.postman.com/t/only-one-test-fail-i-dont-know-why/23342 "2021-05-03T15:05:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![matifniaz1](https://avatars.discourse-cdn.com/v4/letter/m/85f322/32.png) [@matifniaz1](https://community.postman.com/u/matifniaz1)\
**Post date:** [May 3, 2021, 3:05pm UTC](https://community.postman.com/t/only-one-test-fail-i-dont-know-why/23342/1 "2021-05-03T15:05:24Z")

</div>

Please help me my one test fails I don’t know why.  
snapshot attached for reference.

 ![image](https://us1.discourse-cdn.com/getpostman/original/3X/4/e/4ed50960c5848ba59311fe22b7a35f0e22dfccfe.png)

Kindly helps me thanks in advance.

---

<div class="post-metadata">

**Author:** ![neilstudd](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/neilstudd/32/8213_2.png) [@neilstudd](https://community.postman.com/u/neilstudd)\
**Post date:** [May 3, 2021, 6:51pm UTC](https://community.postman.com/t/only-one-test-fail-i-dont-know-why/23342/2 "2021-05-03T18:51:34Z")

</div>

Hi Muhammad,

I haven’t completed the Student Expert training yet, so this is partly a guess, but hopefully it will help you 🙂

The test that’s failing is called “Used variables”. If you select the **Tests** tab of the request, and find the piece of Javascript which contains “Used variables” _(line 61)_, this is the code which is identifying the failure.

The assertion that’s failing says “expected -1 to be above -1”; note that there is only one assertion in that test which is checking for a value above -1, and that is:

```
//auth should also use var
pm.expect(encodeURI(authObj.apikey.value).indexOf('%7B%7B')).to.be.above(-1);

```

If you would like a bigger hint, I will hide it behind the spoiler tag below, however it’s worth trying to solve the puzzle just with the above code, because quite often in the real-world you’ll have to try to figure out why a test has failed when maybe somebody else wrote it!

**Further hint:** `%7B%7B` is the URL-encoded version of the characters `{{`. This test is checking the Authorization for the request, and checking to see whether it’s using a variable. I’m presuming that in one of the tests, it must have requested that you set the authorization using an API key which is set in a variable; if it cannot find `{{` in the API key value, then this indicates that you have not used a variable to insert your API key (maybe you hardcoded the value instead).
