Forum Discussion

skillsoft's avatar
skillsoft
Frequent Contributor
16 years ago

Building easily maintainable testcases in SoapUI

Hi,

Do you have any suggestions for building easily maintainable testcases in SoapUI?  The next version of our product will not be backwards compatible with this one causing us to have to rewrite many of the testcases which will take considerable time.  The version after next will most likely be the same.  This is an internal app, so they can get away with doing this.  In particular it would be good to dynamically create testcases, teststeps from one central location (class/libraries) and have the ability to have templates for the xpath assertions.  If you could point me towards a sample project or web page, that would be great.  I have some time to look at it right now.

Thanks,

Mary
  • skillsoft's avatar
    skillsoft
    Frequent Contributor
    All I'm looking for a yes or no answer and a simple example.  I'm in the process of putting together a proposal.  I'd prefer to stay with SoapUI as it has a lot of useful features and both QA people on the project currently have familiarity with it.  Our other choices would be JUnit, XMLUnit (using Eclipse), QTP with web service addon  or a combination of solutions.  It looks like I have the ability to create classes and I can also create requests dynamically.

    http://www.soapui.org/userguide/scripti ... pt_Library
    http://www.soapui.org/apidocs/com/eviwa ... ation.html


    What I envision is creating a class for each API.  Within the class have a method that builds the soap request and assertion.  Then change the teststeps to a groovy step.  This groovy step would creates this request and asserts the actual vs the expected.  With the API changing dramatically in the next version and possibly quite a bit in the version after that, I want to cut down on maintenance of the testcases. 

    Is what I want to do feasible?

    Thanks,

    Mary
  • It sounds like you have a handle on what needs to be done in your situation. Good luck, let us know if we can help you in any way to work out the details, and please let us know how this works out for you, since I am not aware of anybody else using SoapUI this way.

    /Nenad
    http://eviware.com
  • MHolmqvist's avatar
    MHolmqvist
    Occasional Contributor
    Hello skillsoft,

    Did you manage to build easily maintainable testcases in SoapUI?
    It would be nice if you posted an example.

    Cheers,

    /magnus
  • skillsoft's avatar
    skillsoft
    Frequent Contributor
    Yes and no. I have a class library where a create the requests and assertions which has made things so much easier, particularly with the assertions. With requests I sometimes still need to manually update test cases. An example of when I have to manually update each testcase is when a parameter is added and I'm adding multiple parent elements in the test case. For the responses I have templates where I pass in the expected values. I use default values in many cases where an element is added, I've added global testcases. There are some kinks I need to work out, but due to lack of time, I haven't gotten to it yet. There are also things I would do differently. I was quite new to SoapUI at the time and I'm a QA Engineer that knows how to code, not a developer. The project is quite large and has gone through 3 releases of our product. The original post was 3 years ago and I hardly ever check this board anymore and by chance I did today (I didn't get notified, probably due to a different email address being on this post). What in particular are you looking for?

    Mary
  • MHolmqvist's avatar
    MHolmqvist
    Occasional Contributor
    Hey,

    I am interrested in how to create a request in Groovy code and adding assertions to them. An example would be great.

    > Yes and no. I have a class library where a create the requests and assertions which has made things so much easier, particularly with the assertions. With
    > requests I sometimes still need to manually update test cases. An example of when I have to manually update each testcase is when a parameter is added and
    > I'm adding multiple parent elements in the test case.
    So you don't use Update definition on the interface? Why is this done manually?

    > For the responses I have templates where I pass in the expected values. I use default values in many
    > cases where an element is added, I've added global testcases.
    What if the respons return a list which varies in size? Can the template handle that?

    > There are also things I would do differently. I was quite new to SoapUI at the time and I'm a QA Engineer that knows how to code, not a developer.
    Same here. If someone show me how to do it, or direct me where to find stuff - I can work it out.
    But, in this area, the SoapUI documentation is lacking an overview. I guess it's all in the javadocs, but it's like looking for a needle in a haystack sometimes...

    Thanks for your quick reply!

    /magnus