Cata
4 years agoOccasional Contributor
Can you modify a REST Resource path at a test step level?
Hi,
So I have the following resource path for a REST request: /api/task/7/initialize. The '7' is a dynamic value that is based on a number of tasks that are being created with a previous request. What I need is to take all of the previously created values and update them by using this request so I need to update this request every time with a new value instead of that '7' but I can't seem to be able to modify the resource path at a test case level, only at the API request level and that doesn't help me.
This seems like a really annoying limitation.
Does anyone have any insight on this?
- Hey Cata,
Oh i think youre confusing the two issues. Just cos you have a parent/child relationship between api and teststep doesnt preclude you from updating a value in the teststep's URI during execution. This is standard stuff in ReadyAPI!/SoapUI.
Firstly, you need to create the api with a parameter placeholder (either a RESOURCE/URI/TEMPLATE parm or a QUERY/MATRIX parm)
You stated that the previous teststeps in your test generate the value you want to pass onto the relevant parameterised teststep right?
Then thats exactly what you do when the testcase.executes. there arw multiple ways for a request to source a dynamically generated value. Im typing this out on my phone, but ir no one provides detailed instructions by time im in front of laptop, i will.
Cheers
Rich