question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"${RANDOM.UUID}" not random

See original GitHub issue

After the fix


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:

  1. ${RANDOM.UUID} : To make it random even for the same scenario when used more than once.

  2. ${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:closed
  • Created 3 years ago
  • Comments:16 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
teajayezcommented, May 19, 2020

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!

2reactions
sparrowVcommented, Apr 25, 2020

@authorjapps can I work on this issue. Do you have guide to start the project locally?

Read more comments on GitHub >

github_iconTop Results From Across the Web

How good is Java's UUID.randomUUID? - Stack Overflow
The question is about the quality of the randomness in Java's UUID.randomUUID() , not about the theoretical chances for a given perfect random...
Read more >
Online UUID Generator Tool
Quickly and easily generate individual or bulk sets of universally unique identifiers (UUIDs).
Read more >
Guide to UUID in Java - Baeldung
A quick and practical introduction to UUID in Java. ... we use UUID to identify something and can assign a random value. Therefore,...
Read more >
UUID GUID Oversimplified – Are They Really Unique?
Good read I would say. Though the collisions did occur due to the buggy code not due to pure random chance. 5. What...
Read more >
UUID (Java Platform SE 7 ) - Oracle Help Center
Static factory to retrieve a type 4 (pseudo randomly generated) UUID. long, timestamp() ... If this UUID is not a time-based UUID then...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found