Defining a new variable in order to make a huge iteration giving me an error

前端 未结 1 1496
说谎
说谎 2021-01-25 18:35

I have an endpoint, you can have información about products

{{URL_API}}/products/

If i perform a GET method over that endpoint i will obtain the

相关标签:
1条回答
  • 2021-01-25 19:00

    Your issue seems to be just a basic understanding of how data files work with variables in Postman, here's a simple example that will work the same way for you too.

    This is a basic request I'm using to resolve the variable from the data file - It's a GET request but that doesn't matter as all we're look at here is using a data file to resolve variables. All you need to do is ensure the URL is correct and that you SAVE the request before using the runner.

    Here's a simple CSV file created in a text editor. The heading sku in the name on the variable it will reference inside the Postman request. Each value under that is the value that will be used for each iteration.

    In the Runner, select your Collection from the list (If you have more than one) then select the CSV file. Once imported, you will be able to see a preview of the data.

    If that's correct, press the Run button. The Runner will then iterate through the file and pick up the sku value in the CSV file and use it in the request. I've expanded one of the requests so you can see that the value was used in the request.

    0 讨论(0)
提交回复
热议问题