Forum Discussion

jazzyekim's avatar
jazzyekim
Occasional Contributor
10 years ago

Sharing context properties between TestRunContext and Mock

Hi

Is there a way to get values stored in TestRunContext in MockRunContext ? I create an ArrayList which I initialize in SetupScript section and store it in context like that

def requestList = new ArrayList<String>();
context.put("RequestList", requestList);


But I am going to put some values into this requestList in Mock-OnRequest script section. Is there a way to get that value?

Misja

1 Reply

  • jazzyekim's avatar
    jazzyekim
    Occasional Contributor
    I have solved it in following way - concatenated all requests in one string separated with some delimiter and save it in project variable. Then in test step I split that string using the delim.

    Misja