cancel
Showing results for 
Search instead for 
Did you mean: 

Mock Service Response

manjushak15
Occasional Contributor

Mock Service Response

I have to do Test Automation for Request,Response and Mockservice Response.

 

Following is my SOAPUI Project structure:
Project Name: CurrencyConverter
Request Name: GetConversionRate
Mock Service : ConverterMockService

 

Following is my SOAPUI functional TestSuite:
TestSuite Name:ConverterSoapTestSuiteAssertion
TestCase: GetConversionRate TestCase
Test Steps:
1. Get fromcurrency,tocurrency names from file.(For Input data of request CurrencyConverter)
2. Execuete request "GetConversionRate"
3. Save xml Request and response of request "GetConversionRate" at local drive of windows pc
4. Run MockService "ConverterMockService" and receive mockservice response
5. Save xml response of MockService at local drive of windows pc

how to write test step no 4 and 5 in SOAP UI 5.0.0 Test Case

8 REPLIES 8
nmrao
Community Hero

Re: Mock Service Response

Have a groovy test step at #5.

Please check #2.1 of below link which does the same.
https://www.soapui.org/scripting-properties/tips-tricks.html


Regards,
Rao.
manjushak15
Occasional Contributor

Re: Mock Service Response

Thank you for the reply.

 

This script is for Response.(fror my test case step no #3)

 

// Write the response from the "Test Request: login" TestStep to a file
def currentUser = context.expand( '${#TestCase#currentUser}' )
def response = context.expand( '${Test Request: login#Response}' )
new File( "C:/Users/eviware/" + currentUser + "_response.txt" ).write( response )

 

for mockrequest response ?

 

nmrao
Community Hero

Re: Mock Service Response

Sorry did not get.


Regards,
Rao.
manjushak15
Occasional Contributor

Re: Mock Service Response

Thanks for reply.

 

I have to save mock service response message using test case.

Please find attached file.

 

Thanks

 

 

nmrao
Community Hero

Re: Mock Service Response

What happens when you run the groovy script that you mentioned in Message #3?


Regards,
Rao.
manjushak15
Occasional Contributor

Re: Mock Service Response

Thanks for the reply.

 

I can able to save Request and response.At my following Step:

3. Save xml Request and response of request "GetConversionRate" at local drive of windows pc

 

 

But my next requirenment is run virt and get virt response and save virt response and stop the virt.

 

nmrao
Community Hero

Re: Mock Service Response

are you using free version of soapui?


Regards,
Rao.
manjushak15
Occasional Contributor

Re: Mock Service Response

I am testing in both soap ui pro trial and soap ui 5.0.0 free version.

 

 

New Here?
Join us and watch the welcome video:
Top Kudoed Authors