Running a request multiple times with different data sets : This request does not have any tests

Hello,

Here is my Pre-request Script

var profiles = pm.environment.get("profiles");

if (!profiles) {
    profiles = ["profile1", "profile2", "profile3"];
}

var currentProfile = profiles.shift();
pm.environment.set('profile', currentProfile);
pm.environment.set('profiles', profiles);

Here are my Tests:

var profiles = pm.environment.get("profiles");

if (profiles && profiles.length > 0) {
    postman.setNextRequest('https://myapi.test.com/profile/test');
} else {
    postman.setNextRequest(null);
}

However when I launch the runner I always get this message :

This request does not have any tests

Any idea ? I have the last version of Postman of course 7.0.9.

Thanks !

Hey @p.varin78

Welcome to the community :wave:

I don’t see any tests in the code you posted. A test would be using the pm.test() functionality and these would show in the runner.

You can find more info on these on our learning site.

https://learning.getpostman.com/docs/postman/scripts/test_scripts

You’re right ! Dumb question ! I thought it wasn’t working but it was…