Set parameters for GET REST API call through GlobalVariable

I am unable to set REST parameters value runtime for GET call. I am trying as below. Please suggest the correct one.

RequestObject reqObj = findTestObject(‘Object Repository/UNLOCK GET ORDERS’)


reqObj.getRestParameters().add(new TestObjectProperty(‘searchString’, ConditionType.EQUALS, GlobalVariable.param))

reqObj.getRestParameters().add(new TestObjectProperty(‘fields’, ConditionType.EQUALS, GlobalVariable.param))

def getResponse = WS.sendRequest(findTestObject(‘UNLOCK GET ORDERS’))

WS.containsString(getResponse, ‘OrderDetails’, false)

PN: Refer attached images.

API error.png


Is there any information on how do you know that the parameters could not be set correctly?

It returns some junk value when print the value of reqObj.getRestParameters() on console

could you paste me the whole ‘param’ value, I would like to debug it.

param is list variable. Here are the values
{“orderDetails”:[“order”], “order”:[“customerOrderNumber”,“acceptedDate”,“account”,“groups”], “account”:[“names” ,“details”,“additionalDetails”],“groups”:[“type”,“groupCharItem”]}

Trong Bui said:

could you paste me the whole ‘param’ value, I would like to debug it.

Can you please share if any update on this.


I do appology for missing this case. I have investigated the script and it might not the issue of GlobalVariable usage. Your script is correct. I have adjust it a little bit to make it clear and print out the value.

RequestObject reqObj = findTestObject(‘API - Draft/UNLOCK GET ORDERS’)


List params = new ArrayList<>();

params.add(new TestObjectProperty(‘searchString’, ConditionType.EQUALS, GlobalVariable.param))

params.add(new TestObjectProperty(‘fields’, ConditionType.EQUALS, GlobalVariable.param))


for (param in reqObj.getRestParameters()) {

println param.getValue()


The topic is closed due to inactiveness. Feel free to open a new one if you have any concerns.


I tried this code of your and for some reason it doesn’t work on getting the url and setting of params.