i have below script to generate random string which is tested working fine, and i have an SOAP object which i put ${productId} as variable in the Request message body.
how to parse the “randomString” into ${productId} ?
import static com.kms.katalon.core.testobject.ObjectRepository.findTestObject
import static org.assertj.core.api.Assertions.*
import org.apache.commons.lang.RandomStringUtils
import com.kms.katalon.core.webservice.keyword.WSBuiltInKeywords as WS
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI
import groovy.xml.*
import internal.GlobalVariable
GlobalVariable.TestIssueKey = null
String charset = ((‘A’…‘Z’) + (‘0’…‘9’)).join()
Integer length = 9
String randomString = RandomStringUtils.random(length, charset.toCharArray())
println(randomString)
WebUI.delay(1)
//call the object
def drug = findTestObject(‘Object Repository/Web Service Request/WM6/genericProductUpdate’)
WebUI.delay(2)
//POST DRUG and verification
def response = WS.sendRequestAndVerify(drug)
println(response.statusCode)
assert response.getStatusCode() == 200
the object rs file
genericProductUpdate.zip (1.8 KB)