Tuesday, 6 November 2012

Introduce: Magic Variables

In newest update you will be able to use the Magic Variables. Currently it is two special strings that will be replaced just before sending a request:

${random} - generate random number from 0 to java's Integer.MAX_VALUE
${now} - insert current time (in ms)

You can place it in the URL, in headers list or in payload.

Furthermore, if you like to group generated numbers and use the same generated value in more than one place you can use notation like:

${random:[group_number (int)]}

Each time where particular group occur it will be replaced with the same generated number. See an example:

Use of magic variables
As you can see I use regular ${random} and random with groups (1 and 2). The result is:



I hope you enjoy new feature.
Happy RESTing!

3 comments:

  1. This is a great tool for rest testing. The web server by default adds cookies, but I can't access them in the REST Console. What would be the final piece of the puzzle for me would be the ability to completely manage all the header variables in a transaction response, not just the ones I set, because the webserver sends back additional header variables. Otherwise, an awesome job.

    ReplyDelete