Ask a Question

Variable parameters for all rest-requests

kite001
New Contributor

Variable parameters for all rest-requests

I have an endpoint an resource but the last parameters can be diffrent everytime in URI. I know how to set them for one Request but how can i make it to a variable and change them for all my requests at the same time? I tried to go to my Rest-Project and add properties with variable-name and value but iam not able to insert in parameters then.

Req.PNG

6 REPLIES 6
nmrao
Community Hero
kite001
New Contributor

Thank you, i found a easy way to do it: 

add my property in resources. then it will set the value for child resource and also in my testcase. The problem is now when i change the value its not updated. A workaround to update is to remove the property, make a new one with same name and my new value. Then the new value is stored again in all resource-childs and teststeps. 

When i change the value and press "Revert all parameters to default value" then i get the actual value. but i have to do in all teststeps.. Is there anoth method to "push" or "update"

nmrao
Community Hero

Sorry, I could not follow you.

Would you please show with a screen shot? or a sample test case, export the same and attach here so that it is easy to reproduce.


Regards,
Rao.
kite001
New Contributor

In step 1) i add the "anyid" to my "main-resource" Shop. And in step 2 its added with correct value for all my requests in child-resource and TestStep. Thats what i want. But when i change the "anyid" to another value in step 1 my "anyid" parameter in step 2 is not overwritten with the new value. Its still my value that i set first time. My workaround is to delte the "anyid" in main-resource and add it again with name the same name "anyid" and my new value. Than the new value is set for all like in step 2. Is there an option to push the new value after changed it in my main resource to all my requests in step 2? I hope that was understandable. otherwise you can gladly ask again

 

request.PNG

nmrao
Community Hero

If the request in the service definition is changed then all the request will change. One can't have different parameters each time.


Regards,
Rao.
nmrao
Community Hero

Not just in free tool, even not possible in pro tool.
That's why suggested the solution link in the first reply.


Regards,
Rao.
cancel
Showing results for 
Search instead for 
Did you mean: