Forum Discussion

Mamalazer's avatar
New Contributor
3 years ago

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.model...
  • nmrao's avatar
    3 years ago
    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.