Forum Discussion

masterkeedu's avatar
masterkeedu
Occasional Contributor
16 years ago

Re: How to Migrate (Legacy) Functional Tests into one soapUI suite

We have a huge number of regression test suites that we previously ran using JUnit.  More recently my team has fallen deeply in love with soapUI. We now use soapUI exclusively for all our health checks and performance testing, but we've on major hurdle left.

How can we migrate 1000+ soap requests (currently individual xml files) into one consolidated test in soapUI?

I was thinking about writing a Java class to read each file, and just pump it into a  new soapUI project file.  Someone no my team thinks there might be an easier way to interact directly with soapUI through a Java class.

Any ideas or experience with this?
  • Hello,

    Take a look at this page.

    You should be able to open an existing project and add all your requests using something along these lines:


    //Open an existing project and get the relevant operation:
    WsdlProject project = new WsdlProject("soapui-project.xml");
    WsdlInterface iface = (WsdlInterface) project.getInterfaceByName("Your Interface");
    WsdlOperation operation = (WsdlOperation) iface.getOperationByName("Your Operation");

    //loop through your requests and:
    WsdlRequest request = operation.addNewRequest("<Request name>");
    request.setRequestContent("<insert your request content here>");

    //and don't forget to save...
    project.save();


    Regards,
    Dain
    eviware support
  • masterkeedu's avatar
    masterkeedu
    Occasional Contributor
    Hmm, I think I wasn't very clear.

    The tests are not part of a project, but just a collection of request xmls in a folder.

    We just wrote a little java code to iterate all files in a directory and turn the request .xml into a testcase xml blurb, adding the details like assertions and endpoints. ......

    Then we just pasted the console output (of 100s of test case blurbs) into one new soapUI project's file.

    Thanks for the response!