Skipping collection test but in the results it shows as skipped and failed

No worries. Always happy to help. :trophy:

Another, simpler way (credit to @singhsivcan for this :slight_smile: ) of looking for the status code and skipping the tests would be this:

    let skipTest = pm.response.code === 429;

    // Add this to the beginning of all the tests that need to be skipped when the status code is 429 
    // -> (skipTest ? pm.test.skip : pm.test)
    //
    // For eg:
    (skipTest ? pm.test.skip : pm.test)("Check status code", () => {
        pm.response.to.be.success
    });

This is just using a local variable to check if the response returns a 429 status code and is not using an environment variable, like a mentioned in the first reply. :slight_smile:

2 Likes