Forum Discussion

PaulDonny's avatar
PaulDonny
Regular Contributor
11 years ago

Testing Automation with SoapUI Open SOurce

So I am on route to automate some testing with SoapUI Open Source.

Currently the way I am performing this is using property files in order to determine the values for each run, randomizing data that would need to be randomized, and then going through the steps of the test using groovy as a controller.

I was wondering if anyone had any experience with this and if so, what methods are you taking to perform such actions?

I know that SoapUI is not exactly designed to do this but it seems like a powerful enough tool to be able to perform the actions I require for it.


My current set up:

Groovy Test Step runs and launches a customized UI
User selects property files to run
Groovy randomizes the data in the property and stores everything into a <String,String> map
Groovy checks if test step should be ran using flags in the property file
If so, it enables the test step and reads the XML from the test step, it parses the XML using regex and replaces tags within the XML with values in the property map (The tags in the XML is just the key to the property map)
Groovy takes the parsed XML and stores it to a temporary property
Groovy deletes all assertions from my "Runner" step (The only step in the test case that ever actually runs)
Groovy places all assertions from the currently selected test step into the "Runner" step
Groovy runs the Runner step and checks the assertion
If the assertion fails, groovy asks the user to edit the input XML and try again, if not fail the TC




Drawbacks that I am finding from this method:

My assertions will often pass until it is well after the test step that actually failed.
I use a java controlled system which launches the system at times (The property files are made by a UI that I made as well that just passes it to SoapUI) which means 2 different sources to maintain in 2 different (similar) languages

My other idea is:

Write code in Java to just create the entire SoapUI project and then launch it. This will be 'easier' to maintain since I could encapsulate everything into a single source.


Any suggestions/comments?

2 Replies

  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    I know it's not exactly the answer you are looking for, but there's a lot of this is available as a configuration in SoapUI Pro.
    In my article here - http://www.soapui.org/Go-Pro/working-with-soapui-pro.html - I setup a DataSource test step that loops through the data for both Request input and validation in the assertion.

    This test case can then be easily automated for regression testing - http://www.soapui.org/Test-Automation/functional-tests.html

    Again, this is a different approach from the one you have taken. But this also doesn't reinvent the wheel with custom UI and requires no coding. Unless you want to randomize you datasource (http://www.soapui.org/Scripting-Properties/tips-a-tricks.html#2-3-randomizing-datasource-rows)

    Thanks,
    Michael Giller
    SmartBear Software
  • PaulDonny's avatar
    PaulDonny
    Regular Contributor
    Thanks for the reply.

    Sadly, since I would be distributing this to offshore and independent contractors, SoapUI Pro would likely not be an option for me. The main issue I am running into with SoapUI is the fact that each call has to be manually edited so I am trying to put all of that editing into one nice smooth UI, which I have already done.


    I am just trying to figure out if there is something I have overlooked. I am confident that there is a better way than the way I am doing it to quickly edit everything that would need to be changed. Something that would work with the WSDLs to create the randomization vs having to manually edit the XML to fit my code's needs after updating the XML to fit the API's new needs.


    Anyways, I will look into this further. I am tempted to just dig into the source for the Open Source version and make the edits in the code for what I would want to do. Might be easier that way too.