Hi nmrao
Thanks for the reply, I am mainly interested in identifying the payloads that need to be updated the payloads. I can already overide the request payload but only by identifying the teststep by name. My idea here would be to identify the steps that need to be updated by the method name, then update the payloads either from the example request, an external file or from a groovy script.
In answer to your other questions:
1. yes, I am using SoapUI Opensource, so it doesn't generate the REST Request.
2. The payloads can vary, but I don't see that as being too much of a problem as this could be handled via Groovy
3. Not using swagger, but this is something I am looking to introduce - will this add something to distribute the payload to the test steps?
I parked my line of thought over the weekend and then spent an hour or so trying to find through the APIdocs and forum posts how to get a useful value that would tie back to my request definitions. Looks like these values are not so obvious to query on - maybe I am just a bit rusty. When I try and extract from the test step I get null coming back
context.getTestRunner().testCase.getTestStepByName("GetShoppingCart").getPropertyValue("Method")
I have tried a few speculative names too, like "methodName", "method" etc.
Annoyingly, I can see it on the REST TestCase Properties and I can see it in the xml:
<con:config service="OrderService_PostOrderItems" resourcePath="/{Retail Unit}/{Language Code}/retail/bob/customer/{sourceID}/{customerId}/orders/@cart/items" methodName="PostOrderItems" xsi:type="con:RestRequestStep" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
I found this post - https://community.smartbear.com/t5/SoapUI-Open-Source/change-the-request-type-from-GET-to-POST-using-groovy-in-soap-ui/m-p/149398/highlight/true#M25125 - seemed to provide a way of getting at the property, but haven't had a play yet as I wasn't too sure what the values needed to be for ResourceName, ChildResourceName, MethodName etc. Maybe those are visible in the xml.
I will have another look later today - if anyone could offer any more advice, that would be most apreciated.
Cheers
TEB