In Postman how can I edit the request name from the "Tests" tab using javascript?
In Postman, you can dynamically edit the request name from the "Tests" tab using JavaScript. To do this, you need to set a counter in the collectionVariables with an initial value of 0. Then, in the test tab of your collection, increment the counter after each test. Finally, in the test tab of your request, use JavaScript to set the request name to "Your test name" + counter. Here's an example:
```js
// in the collection tests tab
let counter = pm.collectionVariables.get("counter");
counter ++;
pm.collectionVariables.set('counter', counter);
```
```js
// in the request tests tab
let counter = pm.collectionVariables.get('counter');
pm.test(["Your test name " + counter], function () {
pm.response.to.have.status(200);
});
```
Don't forget to reset the counter in the last request of your collection. Here's an example:
```js
// in the request tests tab (last request of your collection)
let counter = pm.collectionVariables.get('counter');
counter = 0
pm.collectionVariables.set('counter', counter);
```