https://learning.getpostman.com/docs/postman/scripts/postman_sandbox_api_reference/#global-functions-pm
For more trials I have used
pm.test(âBody matches stringâ, function () { var cryptoRandomString = require (âcrypto-random-stringâ); console.log(cryptoRandomString(10)); });
Response on UI, Test Results Body matches string | Error: Cannot find module âcrypto-random-stringâ
Postman sandbox doesnât include crypto. Certain cryptographically secure random number generation related algorithms arenât possible. Iâm afraid, youâll have to impersonate the same using Math.random