create list of object in one Rest request
Hi everbody,
am new to SOAPUI & GROOVY Script,
I would like to create a request test with a list of object "car" in one REST request.
I'm able to read raw from excel file and I don't know how to create the request with groovy code and save the result in a file.
Here the request definition (Json form) :
{
"idCar" : "string",
"idUser" : "string",
"idTypeCar" : "string",
categories : [
{ "idCategorie" : "string",
"nameCategorie": "string"}
]
}
I need to send a request like :
{
{
"idCar" : "id1",
"idUser" : "0",
"idTypeCar" : "Immatriculé",
categories : [
{ "idCategorie" : "id01",
"nameCategorie": "cat01"}
{ "idCategorie" : "id02",
"nameCategorie": "cat02"}
]
}
{
"idCar" : "id2",
"idUser" : "2",
"idTypeCar" : "Immatriculé",
categories : [
{ "idCategorie" : "id02",
"nameCategorie": "cat02"}
{ "idCategorie" : "id03",
"nameCategorie": "cat03"}
]
}
}
Thank you in advance.
- That is not the appropriate way here to create single request with all the rows.
There is a related question in the forum for the same but for generating soap request. One can build json request as well.
https://community.smartbear.com/t5/SoapUI-Pro/How-to-Generate-a-Request-Body-Based-on-Data-from-Datasource/m-p/203916#M46629