Forum Discussion

bpadaraju's avatar
bpadaraju
Occasional Contributor
7 years ago
Solved

REST: How to change child resource path without changing Parent?

Hi. I want to change the path of a child resource, without changing its parent. I've tried editing the path in 'Resource Viewer' but it was changing the parent' path also. Scenario:

I have a REST Project with 1 endpoint and two resources PResource 1, PResource2. The PResource1 has child resources CResource1, CResource2. Both the child resources contain few more child resources each. The paths of the resources are given below:

 PResource1[PathA]

 ->CResource1[PathA/PathB]

 ->->CCResource1[PathA/PathB/PathD]

 ->CResource2[PathA/PathC]

 ->->CCResource1[PathA/PathC/PathE]

PResource2[PathX]

 

Now, my requirement is that the path 'PathA' needs to be changed only for CResource1 and NOT for CResource2. I couldn't do it.

Also, both the child resources has huge number of test cases linked to them, using the methods and REST requests defined for the resources. Hence, the tests need to use the same methods and parameters and values.(So, Cloning the parent resource didn't help either).

Is there a way i could rename the child resource? or may be change it as a parent resource?

 

4 Replies

  • nmrao's avatar
    nmrao
    Champion Level 3
    Are you using Swagger definition or wadl file?
    • bpadaraju's avatar
      bpadaraju
      Occasional Contributor

      Hi guys,

      thanks for your response.

       

      PaulMS thanks, that is a possibility. I will try to implement it and will let you know. But, I also wanted to know if the Child Resource CResource1 could be somehow made as another parent resource in the tree view in UI. Is it possible? 

       

      nmrao I did not have any swagger or wadl file, I created the project manually.

       

      -regards

      bpadaraju

      • PaulMS's avatar
        PaulMS
        Super Contributor

        I don't think that you can move CResource1 to be another parent resource, except by creating it as a new resource then reallocating existing test steps to the new resource/method.