Search code examples
postmanpostman-testcase

PostMan UI Shows a Variable with a Strikethrough Text After Test


I run a PostMan query and receive a Bearer Token. The test sets the global variable named BearerToken as such:

if (responseBody !== "undefined")
{
     tests["Bearer Token = " + responseBody] = true; 
     pm.globals.set("BearerToken", responseBody);  
}

When I view the values in the eye button it shows the Current Value text with a strikethrough:

enter image description here

Upon the next query which uses the BearerToken, it works.

What is the meaning of the Strikethrough?


Solution

  • A strikethrough on a variable would suggest that a variable of the same name is currently in a different scope (Collection, Global or Environment)

    By using the {{..}} variable syntax in the request, you will be able to a list of the variables with the same name and which one the request is using.

    enter image description here

    https://learning.postman.com/docs/sending-requests/variables/#variable-scopes