Both topics suggest using the condition postman.__execution.cursor.length > 1 to determine the context of test execution.
However, with the latest version of Postman (11.1.14) that I’m using, it seems ‘postman’ is deprecated. Although it still works for now, it’s likely to be completely removed in the foreseeable future, right?
The warning you see in the console and the use of that deprecated function are not the same thing.
You’re using postman.setNextRequest() somewhere in your Collection and that should be swapped out to use pm.execution.setNextRequest() - the warning message is telling you that.
Once I remove/comment this line of code, the warning message is totally disappeared.
By the way, my main point in this question is not that warning message, I’m looking for an alternative solution for this postman.__execution.cursor.length > 1 because I do want to detect if the request is running from Collections Runner or just manual click Send button.