Confusion about entering test data

Hi,

I searched the channel for “test data” and didn’t see anything–apologies if I was not using the correct search term.

I have an api like this:

https://someapiserver-test/api/getSomething/a_id/{a_id}/b_id/{b_id}/c_id/{c_id}

There’s a corresponding production server that just has a different base URL.

I have been trying to set up is to be able to swap environments and have the test data adjust accordingly.

Here’s what I’m doing:

  1. From the test, click on the Test Data “tab”.
  2. Click on the “+ New” button.
  3. Click on the Testing Env tab.
  4. Click on the Individual Config radio button.
  5. Click on the “Add Variable(column)” button.
  6. Add a_id, b_id, and c_id in the Add Variable dialog, separated by newlines.
  7. Click OK.
  8. Click on the “+ Add Dataset (Row)” button.
  9. Enter 1, 2, 3 in the a_id, b_id, and c_id cells for Dataset-1.
  10. Click on the Save button.
  11. Click on the left arrow by Data 1.
  12. Click on Test Steps.
  13. Select Data 1 in the Test Data dropdown.
  14. The Select Test Data dialog displays, and Dataset-1 is selected.
  15. Click on the Run button.

This run will fail, as my test data isn’t populated into the URL:

https://someapiserver-test/api/getSomething/a_id//b_id//c_id/

What am I doing wrong?

Thanks!

I think there might be two reasons causing the issue:

  1. Your request step does not reference your test variables. You need to write it similar to the way I did in my screenshot.
  2. The “Data 1” you saved only has test data set for the test environment, so if you run it in another environment, there will be no test data available.

If you could provide some screenshots, we might be able to know what is going on more clearly. Here is more info: Data-driven testing - Apidog Docs


Back from holiday, thank you for your help. This worked perfectly. I think I had been thrown off a bit as I had put variables in previously but had received an undefined variable message–I’m not entirely sure now how exactly I did that or what the precise message was–but thanks to your example I have it working almost exactly how I want it.