Hello,
I have created a data driven Test Suite with CSV Data, which I need to pass into the SOAP Request I am making.
<soapenv:Envelope xmlns:soapenv=“http://schemas.xmlsoap.org/soap/envelope/”>
<soapenv:Header/>
<soapenv:Body>
<getUserDetail>
<userId>${userId}</userId>
</getUserDetail>
</soapenv:Body>
</soapenv:Envelope>
Following way I am binding the variable value into the SOAP Body and making the request:
import static com.kms.katalon.core.testobject.ObjectRepository.findTestObject
import com.kms.katalon.core.webservice.keyword.WSBuiltInKeywords as WS
import groovy.text.SimpleTemplateEngine as SimpleTemplateEngine
def request = findTestObject(‘GetUserDetail’)
def soapBody = request.soapBody
def binding = getBinding()
def variables = binding.variables
def templateEngine = new SimpleTemplateEngine()
def template = templateEngine.createTemplate(soapBody)
request.soapBody = template.make(variables).toString()
def response = WS.sendRequest(request)
Is this the best practice in Katalon Studio for calling SOAP Web Service for Data Driven Automation?