Get property from test case in mock script assertion(SOAP)
SOLVED- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2021
08:05 AM
07-20-2021
08:05 AM
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.
Solved! Go to Solution.
2 REPLIES 2
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-21-2021
12:03 AM
07-21-2021
12:03 AM
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.
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.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-21-2021
01:38 AM
07-21-2021
01:38 AM
Thank you for help
