Create a new and random UUID for an API call
When working with an API call, it may be necessary to create a new and valid UUID. This can actually be accomplished in a single line of code.
def order_id = UUID.randomUUID().toString()
This can be sent to the API object as a variable
mydate = new Date()
def order_id = UUID.randomUUID().toString()
//Initialize Order
initialize_order = WS.sendRequest(findTestObject('Initialize Order',
[('order_id') : order_id,
('date') : mydate]))
Other articles of interest:
- Passing Object Names as String Variables in Katalon Studio
- Working with Dates and Date Formatting in Katalon Studio
- Get the xpath of an object in the Object Repository using findPropertyValue(‘xpath’)
- Katalon Studio – Creating Objects
- Getting started with Katalon Studio
- Passing multiple variables to an object in Katalon Studio
- Using Sets to fill in Form Details with Katalon Studio
- Entering and reading text GetText, SetText and SendKeys in Katalon Studio
- Filling forms with random numbers in Katalon Studio
- Create a Dynamic Object at Runtime
Hi !
I found this blog few weeks ago and it’s really helping me out with my tests!
Thanks a lot for the Katalon tips and tricks !
Keep up the good work 🙂