Day 05: Variables

Hello,

I am attempting to complete the Day 05: Variables. When I run the following request https://api.getpostman.com/collections/12958258-fc4f5a31-180f-47f7-a061-f28505424b49. The following errors are generated:

I have resolved all four errors. All five test cases are now passing.

2 Likes

I am getting this error while running my tests. How did you resolve yours?

Variables added correctly | AssertionError: check global variable: expected β€˜https://api.coindesk.com/v1/bpi/currentprice/{{currency}}.json’ to equal β€˜{{coindeskBaseUrl}}/v1/bpi/currentprice/{{currency}}.json’

Hello,

At the collection level please check that the variables are correct, please see the screenshot below.

Also check that the variables are set correctly for {{coindeskBaseUrl}} and {{currency}}

My variables have been set properly at collection level and global level, but still see the error

Hello,

In the initial value field for the global variable you need a value adding to the field.

Even when the initial value is set it is not working.

Hi @hameethapostman,

Can you please check the requests under the Variables folder, if you are using variables not the actual values?

I believe this thread and this are the same. If, so can you close the other one which is not having any comments, to remove duplicates.

Hi @hameethapostman,

The error message in your scenario is not actually complaining about the setting of the variables; it is checking to see whether you have used the variables in the address of your request. Like this:

Your error message says that you are using api.coindesk.com directly in the URL, whereas you should have changed the URL to use the {{coindeskBaseUrl}} variable.

Thanks in the second step I did the mistake , corrected it and it works.

1 Like