cancel
Showing results for 
Search instead for 
Did you mean: 

SoapUI rest mock start issue from testsuite via groovy script

SOLVED
Highlighted
New Contributor

SoapUI rest mock start issue from testsuite via groovy script

Hi All,

 

I am trying to start rest mock service via groovy script in test suite. I am getting the error using below script

 

def mockService = ["RestMockService"]

context.mockRunners= mockServices.collect{testSuite.project.mockService[it].start()}

 

But same script working fine for Soap mock services

 

def mockService = ["SoapMockService"]

context.mockRunners= mockServices.collect{testSuite.project.mockService[it].start()}

 

Attaching screenshot:

 

Capture.PNG

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Hero

Re: SoapUI rest mock start issue from testsuite via groovy script

Understand. But certainly that is not correct way to do.

Can you please check if there is utility called mockservicerunner under bin directory of the installation? If so run the mock services using that before running the tests.



Regards,
Rao.

View solution in original post

5 REPLIES 5
Highlighted
Community Hero

Re: SoapUI rest mock start issue from testsuite via groovy script

Not sure why are trying to start mock services from test suite.


Regards,
Rao.
Highlighted
New Contributor

Re: SoapUI rest mock start issue from testsuite via groovy script

Hello,

I need it to run build maven script which require to start mock service first in order to validate test cases in test suite. To achieve it I need to start rest mock using groovy script. I am able to start Soap mock service via groovy script but Rest mock start are failing.


Highlighted
Community Hero

Re: SoapUI rest mock start issue from testsuite via groovy script

Understand. But certainly that is not correct way to do.

Can you please check if there is utility called mockservicerunner under bin directory of the installation? If so run the mock services using that before running the tests.



Regards,
Rao.

View solution in original post

Highlighted
Community Manager

Re: SoapUI rest mock start issue from testsuite via groovy script

Thank you Rao!

 

@sbhasin24  Did you solve the issue using Rao's suggestion? Please share.


Sonya Mihaljova
Community and Education Specialist
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
Highlighted
New Contributor

Re: SoapUI rest mock start issue from testsuite via groovy script

thanks Roa,

I resolved the issue using maven plugin. thanks for your suggestion.

New Here?
Join us and watch the welcome video:
Announcements
Script Wanted
Let's start July with new challenges!

Create a script to change request body before sending it to the server for the TechCorner tag!


Scripts created in June:
- A script to generate a request body based on data from Datasource
- A script to go through all response nodes and check the value of the required field
- A Dispatching script to get responses based on the values in Request Body
- A script to add a new tag and assign it to all TestCases in a TestSuite
Top Kudoed Authors