Forum Discussion

SR1's avatar
SR1
Occasional Contributor
5 years ago

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"

No RepliesBe the first to reply