Use test case response in other test case without GlobalVariable

Hi everyone
i have a test case and execute this for get json response.
now i wanna use this response in another test case without create GlobalVersion
how to do it?

Thank You

at the end of first testcase add a Return statement with the variable you want exported.

now, call the first testcase from the second testcase, sort of:

variable = WebUI.callTestCase(findTestCase("Test Case ID"))

the value returned from first testcase will be available in the variable in second testcase

1 Like

tanks for response

i new in katalon and i don’t know how to set response value to Query Parameter field
can you help me?

Hi @s.sajjad1370

In your Test Case A, suppose originally it’s something like this

// Other steps
// Store the response of this request into the variable 'response'
def response = WS.sendRequest(findTestObject('ID of your web service object'))

// Here is the end of your test case

Now you just need to append return response from the test case, so it’s now:

// Other steps
// Store the response of this request into the variable 'response'
def response = WS.sendRequest(findTestObject('ID of your web service object'))

// Here is the end of your test case
return response;

So in another test case, let’s call it test case B, you can do like @Ibus said

def responseFromTcA = WebUI.callTestCase(findTestCase("Test Case A"))
// now you can use it in this test case

Hope it helps

@ThanhTo

tanks for response

is it possible set response value to Query Parameter field?