New Collection Variable Values Not Being Used

Have been testing a simple API login using a couple of declared Collection variables, and all was working fine. However, I tried to test another set of login credentials to check the response for invalid credentials and even though I have updated the Collection variables when selecting Send the console response indicates that it is still using the valid values.

How do I get the test to use the new Collection variable values?

Can you post screenshots of your requests, and details on how you are using\updating the collection variables.

1 Like

@michaelderekjones, there is very little I can show in the screenshots as I need to hide many of the details. As you’ll see, I’m using a GET verb that uses parameters which worked fine with the initial values entered, i.e. those credentials that should work, but now having changed the email/password parameter values when hitting Send the output in the console shows that the original parameters are still being used - and, therefore, I’m still getting a positive response.

If you need any more info, please ask and I’ll provide what I can.

The details need to be in the current values.

Also ensure you have clicked on “save” everywhere possible.

Yes, @michaelderekjones, the values to be tested are listed under Initial value and Current value, they’ve simply been removed as I can’t share them.

Everything is saved, and if I exist the program and return the values are persistent. This is why I am at a loss to understand why it is using old variable values.

If you hover over the variable, it should show you what the current value is and what scope is being set from.

Can you confirm that its a collection variable, and not some other scope.

@michaelderekjones, that’s a neat trick to know. Thanks for pointing it out.

As to which scope is being used, it is reporting it is the Collection scope but displays the original values not the new, saved values.

Again, they’ve had to be removed as I can’t share them.

As @michaelderekjones previously mentioned, can you ensure that all the open tabs are saved.

These might be picking up older values, if you have unsaved changes (tabs with orange dots on them).

You could also try enabling the Autosave feature from the `⚙️ > Settings > General menu options, that would mitigate against certain flows and scenarios not working as expected.

OK, @danny-dainton, things are now working but I’m not sure exactly why.

Though I believe everything was already saved, i.e. if I hovered over the Save button it would pop up the message “No new changes to save”, as advised I enabled Autosave. This didn’t immediately resolve the issue, in that if I hovered over a variable it still displayed the original values not the newly set variable values.

Then when looking at a couple of the provided Collections, i.e. Contract Testing and Integration Testing, I noted the Collection variables were using camel case {{baseUrl}}. In contrast, I had used kebab case ({{base-url}} so I changed mine for consistency.

Following this, I then found if I hovered over a variable name it would display the current Collection variable values, i.e. the new values. If I altered the Initial value then this would also be reflected in the values shown.

So everything seems to be working properly now, but I’m not sure as to what exactly has caused it. That said, I’m grate for the help you and @michaelderekjones have given me. I appreciate it.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.