Data Gen - need help
Hello guys,
I need help, I'm new with new features in soapUI NG pro, before i used to do tests in soapUI and I can't figure out how to generate random data..
Lets say i put some sort of data to excel file, and I would like to randomize such data so every request will be different..
The data types I'm interested in are: String, Int, Bool.
Thanks in advance for any kind of help, would be nice if I will finally figure it out, cheers!
best regards
Emil
There a few different ways of doing this. I typically use a custom groovy script I write to generate data to match my schema constraints, or use a groovy DataSource depending on how much data I need and the memory limitations of creating all of it up front. There's also a data-gen step that can do the same thing.
You can do generate random data by using data gen test step, for say you need to pass random unique date ,
1. Open Data Gen test step,
2. Add property by clicking on + icon by giving desired name
3. Select Type as Script
4. Write groovy script to generate date under Configuration,
def gc = new java.util.GregorianCalendar()
def df = javax.xml.datatype.DatatypeFactory.newInstance()
def datexml = df.newXMLGregorianCalendar(gc).toXMLFormat()
return datexmlNote: Make sure data Gen test step will be the first step under test case.
If you want to pass the Numbers(int) select type as Number and give your required numbers as Start & End.