cancel
Showing results for 
Search instead for 
Did you mean: 

Get property from test case in mock script assertion(SOAP)

SOLVED
Mamalazer
New Contributor

Get property from test case in mock script assertion(SOAP)

Hello. How can i get property from test case in mock script assertion?

I try to use:

 

1) def groovycase = testRunner.testCase.getPropertyValue("propcase")

2) def testCase = messageExchange.modelItem.testCase;
    def expected = testCase.getPropertyValue("propcase");

 

but it doesn't work because i get error. 

 

 
 
 
 
 
1 ACCEPTED SOLUTION

Accepted Solutions
nmrao
Community Hero

Re: Get property from test case in mock script assertion(SOAP)

Just think of it. If you are running the test against real services, will the real service know anything about its client or invoker? Answer is "No". Iisn't?

Similarly mock service doen't know either about the client.
If the service needs any information, that has to be available either in the request or in the headers.
If you need some value and it is not part of payload or something, you can optionally pass the value in the custom header and access the same customer header in the mock service. Of the same header will be available in the real service too.


Regards,
Rao.

View solution in original post

2 REPLIES 2
nmrao
Community Hero

Re: Get property from test case in mock script assertion(SOAP)

Just think of it. If you are running the test against real services, will the real service know anything about its client or invoker? Answer is "No". Iisn't?

Similarly mock service doen't know either about the client.
If the service needs any information, that has to be available either in the request or in the headers.
If you need some value and it is not part of payload or something, you can optionally pass the value in the custom header and access the same customer header in the mock service. Of the same header will be available in the real service too.


Regards,
Rao.

View solution in original post

Mamalazer
New Contributor

Re: Get property from test case in mock script assertion(SOAP)

Thank you for help

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