Forum Discussion

jjam's avatar
jjam
Contributor
4 years ago

Missing REST Resource for Request

I've changed a few resource paths while working on this project. But now when I import or open Ready API 3.3.1 it asks to "Select a new REST Resource to place Request "Copy of Login" in". Among other tests that have "Copy of" in the name. 

 

The thing is all my test cases and steps do not have "Copy of" anymore. They temporarily have "Copy of" while I am building the project. 

 

Why is SoapUI asking for REST resources that there is no longer a request existing in the project by that name? I try to play along and assign resources but then it creates the tests, which I don't want. Is there some sort of cleanup that is missing here. When I delete test cases and steps, SoapUI should not remember them.

 

This is really annoying because if I share the project it looks ridiculous for the other user to get these prompts upon opening the xml.

5 Replies

  • richie's avatar
    richie
    Community Hero

    jjam 

     

    As youre not using the latest version, Smartbear would suggest updating to the latest v3.3.2 - although I don't always advocate this unless the changes between versions 3.3.1 and 3.3.2 actually included changes likely to impact your issue, but you might want to update - it couldn't hurt, right?

     

    You mention 'building' your project.  e.g. "They temporarily have "Copy of" while I am building the project." - what do you mean by 'Building the project'?  Can you be a bit more specific just so I understand a little better?  Do you mean something to do with updating the files of a composite project before you checkin the changes or do you mean something else?

     

    The way you talk about building the project it sounds like this is a repeated action - so this keeps occurring?  Is that correct?

     

    I'm assuming you've gone through the process a couple of times trying to clean up the project and it keeps happening each time after your 'build process' - is that right?   Does it happen for any other projects if you alter the resource path - or is it only this project?

     

    If I understand what youre saying then its obvious that something's repeatedly causing some corruption in the project file.  I'm guessing a bit here cos I dont know what the process is your talking about - but once you've done your build process you could clean the project (removing all the rubbish, make a copy of the file) as I suspect theres some extra rubbish in there that isn't being removed despite it appearing ok in the UI, so when you redo your build process, this is the cause of the additional rubbish.  If you clean all the rubbish out properly, then I suspect you wont get the problem again - but the project file has got to be cleaned properly.

     

    If you need to edit your file and its a composite - you can revert it back to a flat file to clean and then convert back to composite once you've gotten rid of the rubbish.  Whatever process youre using to add in resources/tests to get rid of the prompt when you import a project and then delete them all again isn't working properly and isn't deleting all the rubbish completely from the underlying file, but my suggested approach should work - if everyone was struggling with this then I wouldn't expect this to work - but its only you at the moment (at least youre the only person to post on the forum about it), so I'm guessing if you clean your file properly this wont happen anymore.

     

    ta

     

    rich

    • jjam's avatar
      jjam
      Contributor

      richie 

       

      Thanks for the detailed response.

      1. I will look to the team for when we are updating as we manage a git repo. It looks like a minor revision is missing, I don't think we all update for minor revisions unless there is a need. I will review the release notes.

      2. My use of "Building" means I make copies of test steps to complete coverage of error scenarios, in which I usually leave the default "Copy of" when I clone the step and rename later. I will work on a request to get a happy path (200 OK) and then clone the step and work on generating the error in the Copy of step. Also sometimes I will make a copy while I try different payloads thus preserving my original step configuration. When the project is finished I do not have "Copy of" in my test case or step names.

      3. Although the team is using the git repo I am slow to conform and I am still working with regular projects with the one XML project file. I will be working with a teammate soon to define how I can avoid merge conflicts when I work on the team's composite/git project. But regardless the issue resides in a regular project.

      4. About "cleaning the file. I have an XML editor and when I find "Copy" I can return entries like this:

       

      <con:testStep type="restrequest" name="Copy of Login" id="f1dbb4ac-e214-462b-b335-1872bcfd6e27">

       

      That would be one of the offenders. 

       

      Is there some documentation or tips you can give me on cleaning files or is it more trial and error?

       

       

       

       

      • richie's avatar
        richie
        Community Hero
        Hey jjam,

        As far as im.aware there's no help for editing the project file as Smartbear would never recommend doing it as it would be too easy to break the file resulting in the file either becoming corrupted to the point the project wont open or if the project successfully opened in ReadyAPI! it would be a mess, so editing is really just trial and error.

        Its been a couple of years since i did this sort of editing, but i remember a couple of points.
        1. The file is sequential so take a screemshot of what your project looks like in the navigation frame so you can work out where you are in the file.
        2. If you start deleting steps make sure you remove the whole containing tag thst corresponds to the test step.
        3. Pay attention to the.GUID values. They are repeated more than once in the project .xml file, so if you remove one, you need to remove the other.
        4. Creat a basic project file with only 1 or 2 testsuites and a couple of testcases that contain an example of each of your test steps (in the project you are having problems with) and try editing this first so you get familiar with the file contents.
        5. In your example you mentioned the content looks something like this.
        <con:testStep type="restrequest" name="Copy of Login" id="f1dbb4ac-e214-462b-b335-1872bcfd6e27">
        Just double check before deleting so instead, chsnge the stepname from "Copy of Login" to i domt know "W", save the changes, close the .xml editor and launch ReadyAPI! to see the changes youve made so you know you are editing the correct test case or test step. Then re edit the file and remove once youre sure you can delete that part of the .xml.
        6. Use somethinf with an .xml parser like XMLSpy or notepad++ (with the xml plugin) etc. You want to do the editing in a tool you can instantly check if the file is still wellformed.

        Ta

        Rich