ContributionsMost RecentMost LikesSolutionsAdd the responses to a list in Mockservice's OnRequestScript and refer it in the Project's testsuite I have a mockservice that listens on port 80 and receive the JSON callback from a API server. Rightnow im using the below code in OnrRequest script to get the response and assign it to a project's property like below. mockRunner.mockService.project.setPropertyValue("ResponseBody",requestBody) In the testsuite, i poll for the "ResponseBody" and when it gets some value then I read the responsebody value and process it in the testsuite. After processing i will move to the next hit. The polling/waiting is consuming time and instead of waiting for the callback response i want to complete all the hits and finally process the callback responses collected in the mockservice. Is there anyway to collect all responses in the mockservice and refer the list in the testsuite? i tried below but Im not sure whether its correct or not. In the Mockservice's "Start Script" i put the below code def mockList=[] context.setProperty("MockResponseList",mockList) In the Mockservice's "OnRequest Script" i put the below code def requestBody = mockRequest.getRequestContent() def jsonResponseList=context.getProperty("MockResponseList") jsonResponseList.add(requestBody) 1)but i dont know how to refer the above jsonResponseList in the project's testsuites 2)jsonResponseList will stay the same for each OnrequestScript call? or it will be unique? 3)Is there anyway to collect all responses in the mockservice and refer the list in the testsuite? 4)What is the best way to collect all responses and process in one go? Re: List set in Context.setProperty of testSuite modifiable in testCase context but not string,int etc Thanks so much. Could you please help me with the following question? https://community.smartbear.com/t5/SoapUI-Open-Source/Mockservice-and-Testsuites-running-fine-in-the-soapUI-tool-but/td-p/191925 Mockservice and Testsuites running fine in the soapUI tool but not from the commandline Hi All, I have testsuites to test a asynchronous service which sends callback response at anytime(no fixed duration). So i set up a mockserver(mockservice in soapUI) which listens on port 80 and when it receives the callback response from the asynchronous service it writes the response to a project property using the "OnRequestScript" like below mockRunner.mockService.project.setPropertyValue("ResponseBody",requestBody) and i access that project property in the testsuite using the below code. responsefromMock=testRunner.testCase.testSuite.project.getPropertyValue("ResponseBody") The above set up is working fine and im able to run the mock server and testsuites in the soapUI tool.But when I run the mockserver and the test suites from the command line, the mockserver is up and running in port 80 but testsuite is not able to get the response from the mockserver and the script is failing. I think the project property ("ResponseBody") set by the mockerver is not read by the testsuite. Please help me with this issue. Following is the way i invoke mockserver and test suite. both mockserver and testsuites are in the same project "soapui-project.xml" 1)mockservicerunner.bat -m "Rest-MockServer1" "H:\SoapUI-Scripts\soapui-project.xml" 2)testrunner.bat -j -f"H:\SoapUI-Scripts\Results" "H:\SoapUI-Scripts\soapui-project.xml" Re: List set in Context.setProperty of testSuite modifiable in testCase context but not string,int etc Thanks for your reply Sir. Good answer. So If i want to share&update the primitive types between testcases, can i have the primitive values as members in a class and create a object in testsuite context and update the members in different testcases? will it work? object will be reference copied or value copied? please advice. List set in Context.setProperty of testSuite modifiable in testCase context but not string,int etc In soapUI, I have a List in testSuite which I setup using context.setProperty is visible and modifiable in testcase1 and testcase2 . I'm able to modify the list in both testcases , but I'm not able to do the same for strings or integers or floats etc. Please see the below code and guide me accordingly. I know that we can use propertyValue to set/change string, but I don't want to use that as my string size is very huge and i have array of such strings. /*soapUI groovy code: //In TESTSUITE: List l=[] context.setProperty("list",l) String str="suite" context.setProperty("string",str) //In TESTCASE1: log.info("From TC1") arrlst=context.getProperty("list") for(lst in arrlst){ log.info(lst)} arrlst.add("First added in TC1") for(lst in arrlst){ log.info(lst)} //prints "First added in TC1" str=context.getProperty("string") log.info("The string is"+context.getProperty("string")) //prints "the string is suite" str="This is TC1!" log.info("The string is"+context.getProperty("string")) //still prints "the string is suite" context.setProperty("string",str) log.info("The string is"+context.getProperty("string")) //prints "the string is this is TC2" but its in TC1's local context //In TESTCASE2: log.info("From TC2") l1=context.getProperty("list") for(lst in l1){ log.info(lst)} //prints "First added in TC1" str=context.getProperty("string") log.info(str) //prints "the string is suite" not the value set in the testcase1 */ why im able to change/modify the list in other testcases but not the strings, integers etc?