Forum Discussion

mmoser18's avatar
mmoser18
Frequent Contributor
9 years ago

Copy service and testsuite into another project

I am trying to consolidate a bunch of smaller soapUI projects files (testing different, independent services) into a common file.

 

Doing so, I had to learn that it is obviously not so trivial to copy a service and its associated test-suite using that service from one file into another. When I export a test-suite and copy it into another project then in the copy ALL parameters (and their assigned value) are lost.

What is the most elegant solution to do this with the least loss of information (i.e. also coping parameters, headers, assertions, etc.). What do I need to (re)define in the target project so that the test-cases and -steps are properly copied INCLUDING all their settings.

 

Or can one do that on the xml-file directly? Which elements would I need to copy from file A to file B? Or is this completely hopeless? This can't be such an exotic requirement - can it?

 

Michael

  • rupert_anderson's avatar
    rupert_anderson
    9 years ago

    Also, as an alternative, is the 'clone' option on a your TestCase useful at all? 

  • rupert_anderson's avatar
    rupert_anderson
    Valued Contributor

    Hi Michael,

     

    Does seem like a reasonable functional improvement.

     

    My quick thoughts are:

    • (short term hack) As you say manipulating the project XML file is an approach, I've done this before for smaller tasks. It should definitely work, but always work on a back-up of course!
    • (medium term) There will probably be a Groovy script approach to cloning the objects involved. Whilst this would probably be a repeatable solution that you could share, it would probably be a reasonable effort. I once did a Groovy script to propagate changes in a service definition to all POST TestSteps in all TestSuites and TestCases, it wasn't too bad.
    • (long term) Maybe fill out a SoapUI feature request (https://community.smartbear.com/t5/SoapUI-Feature-Requests/idb-p/SoapUIFeatureRequests) - then wait for someone to pick it up (could be slow, but does happen, I coded a simple one recently).

     

    Regards,

    Rupert

    • mmoser18's avatar
      mmoser18
      Frequent Contributor

      Hi Rupert

      thanks for responding. I will fill out that request for sure!

       

      Meanwhile I tried to experiment with the export/import features of soapUI but these don't seem to work at all!

       

      I exported a test-case from project A. Then - in project B - I defined a service containing a resource containing a method with all the same parameters - ALL with the exact same names as the ones in project A.

      Then I imported the previously exported test-case.xml into project B into a specific TestSuite.

       

      I get popups re. some missing REST resource for each test-step and I select the above created resource for each (since all test steps in this sample refer to the same method). At the end I have the same number of test steps (i.e. the names of the test-steps made it over) but when double clicking onto any of the test steps nothing happens (right-click => OpenEditor: same result: nada), i.e. these imported test-steps all seem to be empty or faulty.

      So, except the names of the test steps apparently NOTHING was imported and whatever got imported is useless.

       

      This is a joke! :-(

       

      • rupert_anderson's avatar
        rupert_anderson
        Valued Contributor

        Hi Michael,

         

        Sure, sounds frustrating, but open source products are here for us to improve :-)

         

        I must admit I've never used the import/export functionality on a level less granular than project level (which I think worked fine last time I did it).

         

        Maybe there's a problem exporting/importing TestCase's where there is a dependency on a more global object e.g. a service definition which is defined at project level? Its just a guess, but maybe only non-dependant TestSteps within the TestCase export fully? I haven't had time to try it, but I guess if you look in your exported TestCase.xml maybe there are details missing which mean your TestSteps don't get fully replicated on import? 

         

        Were there any error messages in any of the logs on import or export?

         

        Regards,

        Rup