How to view URL variables in test collection summary screen

When I run a collection of tests I want to be able to see the request URL, with the variables it has used for that request. Currently the summary screen shows the URL with the variable placeholders, it doesn’t show the values used for each call.

I know I can use console.log(pm.variables.replaceIn(pm.request.url.toString())); to view the request URL but I want to see this in the summary screen when i run a collection of tests.

I have used: tests[Response Body: ${responseBody}] = true; to ensure response body is shown in summary screen, is there a similar option for the Request URL as well?

Stick something like the following in the tests tab at the collection or folder level, so it runs after each request in the collection or folder. Change the format as you see fit.

const method = pm.info.requestName + " - " + pm.request.url.path.join("/").replace(/^api\//, "");
pm.environment.set("currentMethod", method);

Then in your actual tests, you can include the method in the test name like this…


var method = pm.environment.get("currentMethod");

pm.test(`${method} - Test Name`, () => {
    //
    //
    //
});

Those back ticks are important. Don’t use double quotes. I have no idea why it has to be like this. Would be nice if someone could explain the difference between that backtick and a single or double quote. All I know is that if you use a normal quote, it will think its part of the string.

Sorry, just realised that you are talking about the request URL’s, not the tests.

Just tried this, and as you’ve mentioned, it shows the variable name, not the actual value.

Can’t see any options that might change this.