i updated this post as i have another question now.
I have many Parameter to test and thinking can I just use one object repo and move the query parameter to test scripts?
otherwise i have to created many GET objects repo with just different set of parameters.
please advise if Katalon allowed to do it in test script?
example the GET supporting 2 parameter , name, drugId
I want to create one GET object, and input all parameter in the object.
but at test script i want to have flexibility to call one param only. right now i saw the object URI has 2 param, how to call one param only? or i really have to create so many objects and keep one param in one object?
is that possible?
Test script
import static com.kms.katalon.core.testobject.ObjectRepository.findTestObject
import static org.assertj.core.api.Assertions.*
import com.kms.katalon.core.webservice.keyword.WSBuiltInKeywords as WS
import groovy.json.JsonOutput as JsonOutput
import groovy.json.JsonSlurper as JsonSlurper
import internal.GlobalVariable as GlobalVariable
GlobalVariable.TestIssueKey = ‘PM-6630’
GlobalVariable.Paramname = “Actiq”
GlobalVariable.ParamdrugId = “FF1/M2/P2”
///GET by param drugId
def test1 = WS.sendRequestAndVerify(findTestObject(‘Web Service Request/drug-service/ApiDrugbyParamQueryGet’, [(‘drugId’) : GlobalVariable.ParamdrugId,(‘SiteHostName’) : GlobalVariable.SiteHostName , (‘Port’) : GlobalVariable.Port]))
WS.verifyResponseStatusCode(test1, 200)
def test1List = new JsonSlurper().parseText(test1.getResponseText())
println(‘response text: \n’ + JsonOutput.prettyPrint(JsonOutput.toJson(test1List)))
assertThat(test1List.data[0].drugId).isEqualTo(“FF1”)
assertThat(test1List.total).isEqualTo(1)
///GET by param name