3

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?

ΩmegaMan
  • 29,542
  • 12
  • 100
  • 122
  • 1
    Do you have the same variable `BearerToken`set in a different scope? Variables work in scopes an so if you have something set in a different scope, then the one with the narrowest scope will take precedent and the others would have that strike through. Is there a tool tip? – Danny Dainton Jan 20 '21 at 08:11
  • The variable was used/created with a different older collection and my new collection is a separate distinct unit from it. As to a tooltip, no amount of hovering over the area, title or associated pen icon provides a tooltip. – ΩmegaMan Jan 20 '21 at 09:52
  • As an aside, the variable was set by hand in the aforementioned collection and not set programmatically as show in my latest collection. – ΩmegaMan Jan 20 '21 at 10:42
  • 1
    If you try and use the `{{BearerToken}}` variable syntax in a request param, for example, you should see another variable in the auto-suggestion list and that would be the one that's overriding the strikethrough one. – Danny Dainton Jan 20 '21 at 17:16

1 Answers1

7

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

Danny Dainton
  • 23,069
  • 6
  • 67
  • 80
  • 1
    Duplication was the issue as you provided. Thank you for taking the time to reply. – ΩmegaMan Jan 20 '21 at 18:21
  • 1
    We could have presented that information better and in all the places. I've flagged that up with the team. – Danny Dainton Jan 20 '21 at 18:55
  • Your initial suggestion about getting a tooltip I believe would be the best vehicle to get that info across. Otherwise I shall wait for the C#/WPF version. ;-) Thanks again. – ΩmegaMan Jan 20 '21 at 19:56