How to read and update json messagein Groovy script via SoapUI NG pro
Hi I am new to SoapUI pro NG tool and Groovy scripting.
I have to perform below steps in my project suite. I have use POST or PUT method so that json message will be sent to server and get the response. The excel sheet will be my data sink here.
1. Read sample Json message
2. update the json message attribute values
3. post the message to server
4. Capture the response of json message and validate for any error.
If someone can provide the basic steps for writing the code in Groovy scripting I don't have idea what all package i need to associate while running groovy step.
Sample Json message
{
"type":"HAM",
"hotelCode": "HHHHHH",
"lastUpdatedUser": "TOGAF003",
"hotelAttributeItems": [
{
"type": "HAM",
"hotelCode": "HHHHHH",
"PMSAttributeCode": "KN",
"PMSAttributeName": "KingBed",
"DSPCategoryCode": 2,
"positionInCategory": 2,
"DSPItemCode": "MTED0001",
"attributeName": "1KingBed",
"isDSPSellable": "Y",
"allowRequestOnly": "Y",
"allowInGRT": "Y",
"zeroCharge": "N",
"isPremium": "N",
"isGuestViewable": "N",
"isActive": "Y",
"remarks": "testing one."
}
]
}
Thank you in advance.
Satish