Reputation: 47
This is what I have currently:
def transactionID = "${java.util.UUID.randomUUID()}";
context.testCase.setPropertyValue('transactionID', transactionID)
Upvotes: 3
Views: 4707
Reputation: 42184
UUID has always a form like 0e62c22e-f590-4e9c-9f29-bc7231453da4
, but you can convert it to string and call String.replaceAll('-','')
to remove all hyphens:
def transactionID = UUID.randomUUID().toString().replaceAll('-','')
println transactionID // e.g. ea3b6994ca104d54b7d9b12f32eb7878
Upvotes: 7