Forum Discussion
nmrao
9 years agoChampion Level 3
You script is actually missing the object in color
Here is the script to start mock service:
//To start mock service
//Change the service name as needed. def name = 'GlobalWeatherSoap MockService' def wsdlMockService = testRunner.testCase.testSuite.project.mockServices[name] wsdlMockService.start() if (wsdlMockService.getMockRunner().isRunning()) { log.info("+++++++++ Mock is running") }
Stop script:
//To stop mock service //Change service name as needed. def name = 'GlobalWeatherSoap MockService' def wsdlMockService = testRunner.testCase.testSuite.project.mockServices[name] wsdlMockService.getMockRunner().stop()
- duccio_fabbri9 years agoNew Contributor
Thank you for your hint. I tried but I have the same issue.
After the line:
wsdlMockService.getMockRunner().stop()
the istruction:
wsdlMockService.getMockRunner().isRunning()
returs the error:
- Thu Sep 15 13:20:32 CEST 2016:INFO:---- ERROR: Cannot invoke method isRunning() on null object
If I comment the line with .stop(), no error.
I don´t understand if this is by design or not.
Thanks
- nmrao9 years agoChampion Level 3The sample code snippets provided to you after testing them only.
You can just try to add a test case with two separate groovy scripts, and both and try.- duccio_fabbri9 years agoNew Contributor
Your snippets are OK! I tried and they work perfectly.
But please, try to add this line to your second snippet:
log.info("wsdlMockService.getMockRunner().isRunning() returns: "+wsdlMockService.getMockRunner().isRunning())
I receive an error.
Same line, after snippet 1, returns "true".
Is it ok?
Related Content
- 2 years ago
- 4 years ago
- 2 years ago
Recent Discussions
- 15 years ago