动态/随机变量
Postman uses the faker library to generate dummy data. You can generate random names, addresses, email addresses, and much more. You can use these pre-defined variables multiple times to return different values per request.
You can use these variables like any other variable in Postman. Their values are generated at the time of execution and their names start with a $ symbol e.g. $guid, $timestamp etc.
The following is a list of dynamic variables whose values are randomly generated during the request/collection run.
To use dynamic variables in pre-request or test scripts, you need to use pm.variables.replaceIn(), e.g. pm.variables.replaceIn(’{ {$randomFirstName}}’).
Common
Variable Name Description Examples
$guid A uuid-v4 style guid “611c2e81-2ccb-42d8-9ddc-2d0bfa65c1b4”
“3a721b7f-7dc9-4c45-9777-516942b98e0d”
“22eca807-006b-47df-9511-e92e37f5071a”
$timestamp The current UNIX timest