@Ibus
Your suggestion is great and I have tried it the following way as you have suggested.
We have an array (thousands) of values for “to” field in the json given below. I tried it but couldn’t achieve the results. When I execute the test, the n’th string of the “to” field is executed. Also, the response is throwing the errors though I get the 200K success status code.
Any thoughts, please ?
‘Given’
WS.comment(“Setup”)
requestUrl = url
adminToken = token
def text = ‘’’{"_id": “someString1”, “to”: “${to}”, “launch”: true}’’’
def template = new groovy.text.StreamingTemplateEngine().createTemplate(text)
def binding = [
to : “someSting2”
to : “someSting3”,
-------
-------
to : “someStingn”]
String response = template.make(binding)
request = findTestObject(‘Object Repository/external (SendGrid)/LaunchCampaign.ContentJSON(url,body,token)’, [ (‘url’) : requestUrl, (‘body’) : template, (‘token’) : adminToken ])
‘When’
WS.comment(“Sending POST request: ${request.getRestUrl()}”)
WS.comment(“With body: ${request.getHttpBody()}”)
response = WS.sendRequest(request)
println (response)
‘Then’
WS.comment(“Check response status”)
WS.verifyResponseStatusCode(response, 200)
Response Error :-
groovy.lang.MissingMethodException: No signature of method: static com.kms.katalon.core.webservice.keyword.WSBuiltInKeywords.verifyResponseStatusCode() is applicable for argument types: (java.lang.String, java.lang.Integer) values: [200 101 bytes, 200]
Possible solutions: verifyResponseStatusCode(com.kms.katalon.core.testobject.ResponseObject, int), verifyResponseStatusCode(com.kms.katalon.core.testobject.ResponseObject, int, com.kms.katalon.core.model.FailureHandling)