Learn how to use pre-request scripts in Postdata.
pw
object containing various methods to create scripts and tests. The pw
object is global and can be referenced by name to access methods.
For example, to set an environment variable, you can use the pw.env.set()
method.
pw.env.set()
can be used directly for quick and convenient environment variable definition. It can be used to better organize request codes.
<<variable_name>>
. So the URL will be <<baseURL>>/<<method>>
.
https://reqres.in/api/users/
.
Add <<randomValue>>
to the endpoint URL.
randomValue
and the API will return a random user associated with the random value.
You will get a similar response as shown below: