"${RANDOM.UUID}" not random
See original GitHub issueAfter the fix
- https://github.com/authorjapps/zerocode/wiki/Token:-Random-Number
- https://github.com/authorjapps/zerocode/wiki/Token:-Random-UUID
I’m using “${RANDOM.UUID}” in a single file to generate random UUIDs for multiple values. Expected behavior is that each reference to “${RANDOM.UUID}” will substitute a new UUID - the way “${RANDOM.NUMBER}” works. Instead the same UUID is being substituted for all references in the file.
AC1:
-
${RANDOM.UUID}
: To make it random even for the same scenario when used more than once. -
${RANDOM.UUID.FIXED}
: To make it random per scenario, but fixed(repeated if used more than once) in the same scenario (Currently${RANDOM.UUID:10}
is behaving this way, just bring the same behaviour to${RANDOM.UUID.FIXED}
)
Update:
- ${RANDOM.NUMBER} : Currently random per scenario, but not inside a scenario
- Please bring this behaviour to `${RANDOM.NUMBER.FIXED}`
- ${RANDOM.NUMBER:10} : Random per scenario, also random inside a scenario 👍
- Please bring this behaviour to `${RANDOM.NUMBER}` too
- Keep ${RANDOM.NUMBER:10} behaviour as it is, no changes required.
- 10 above is just for example, it can be any number between 1 to 19...
Why?
Scenario 1:
You have a scenario with 10 steps and you create an "applicationId"
by using the ${RANDOM.UUID.FIXED}
. This can be simply reused in all your 10 steps(once, or more such as twice or 10 times or 15 times or any number of times) to refer to the same ID. This takes off the hassles of referring to this UUID everytime via a JSON Path.
Scenario 2:
This is my use-case
e.g.
You have a scenario with 10 steps and you use ${RANDOM.UUID}
to generate "applicationId"
as well as "personId"
. Here you want both of them to be different UUIDs rather than the same id.
The point here is, we will retain both the above functionalities!
AC2:
The same needs to be done for ${RANDOM.NUMBER}
and ${RANDOM.NUMBER.FIXED}
AC3:
Wikis to be updated related to this:
Issue Analytics
- State:
- Created 3 years ago
- Comments:16 (7 by maintainers)
Top GitHub Comments
Hey folks! I just got the latest and it does what I need it to now: each use of ${RANDOM.UUID} gives me a random UUID within the scenario. Thanks so much for adding this!!! will save me lots of time on the testing I need to do. Love your product!
@authorjapps can I work on this issue. Do you have guide to start the project locally?