Tuesday, May 20, 2008

SoapUI, CI and Coverage

In the first two parts(part 1 and part 2) of this series we have seen how to use SoapUI to write functional tests for web services and also how to use Groovy for test setup, properties transfer, and assertions. As we have already said, tests should be integrated with your builds and should be able to be run with them. If you have automated your builds and they are running as part of your continuous integration (CI) setup, SoapUI comes in even handier: you can run the test suites and the test cases you created and, moreover, you can generate JUnit reports.

This part of the series guides you step-by-step through the Ant tasks for running tests written using SoapUI, generating JUnit reports, integrating with CI, and to top it all off getting code coverage using Cobertura. When you are done with this part, you will be able to reap the benefits of writing tests, continuous integration, and code coverage.

Read the complete article here at Javalobby.

Functional Web Services Testing Made Easy with SoapUI - Part 3

15 comments:

  1. Hi Meera,

    I have explored SOAPUI to some extent and very confident of how SOAPUI can help in testing web services.

    I have seen in some sites that, Groovy scripts are very useful for testing of web services in SOAPUI

    This statement has created below doubt in my mind
    1. Why does one need to work on Groovy script to provide the same functionality which is already present in the SOAP GUI?

    2. What are those features one can achieve by using Groovy scripts which cannot be achieved using the SOAPUI GUI (ie., in Menu bar/Tool bar)?

    Could you please help me in understanding these doubts.

    ReplyDelete
  2. Hi Krishna,
    If you are using the Pro version of SOapUI, than you definitely don't need to use Groovy. Groovy is used within SoapUI for customizing the test scripts. For e.g, you might want to read data from a database, access a file, write to a file etc etc all these can be easily done within the setup and tear down scripts using Groovy.

    Also, if you want to parse the response, add additional asserts it can be done easily using Groovy.

    Hope this clears your confusion.

    ReplyDelete
  3. Hi Meera,

    Tats a really awesome blog for a begginer to get a fair idea of SOAPUI.

    I have just started using SOAPUI and was curious to know how we can do the following

    Transfer Data from Properties to Request using groovy script.

    I have the scripts to get properties value from file and transfer an individual prop to request.

    But wat I need is a script which can transfer all the data from a property to respective attribs in a request in one go.

    Thanks
    Gurpreet

    ReplyDelete
  4. Gurpreet,
    You should be able to use Groovy for this also. Not sure what problem you are having.

    ReplyDelete
  5. try to set property on groovy level.
    See the example.
    It is working.


    //get step
    def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context )

    groovyUtils.setPropertyValue("REV_AVM_MSP", "endpoint", "http://10.48.135.180:7001/services")

    ReplyDelete
  6. Use setPropertyValue on groovy level.

    See example.

    //get step
    def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context )

    groovyUtils.setPropertyValue("REV_AVM_MSP", "endpoint", "http://10.48.135.180:7001/services")

    ReplyDelete
  7. hi meera, r u aware of any books on soap UI pro?

    essentially we are working on a project with lots of soap ui scripts and looking for quick way of understanding the scripts.

    internet help seems ok, but that might take longer time. :-(

    ReplyDelete
  8. There aren't any books on SoapUI I am aware of.

    Did you try contacting the SoapUI team?

    ReplyDelete
  9. Hi Meera,

    It was a wonderful tutorial for a beginner.
    I am facing one issue (ConnectException) while trying to run testsuite from "Launch TestRunner" in SOAPUI 3.5 and i am running it under proxy. I have set the proxy settings
    -Dhttp.proxyHost=******
    -Dhttp.proxyPort=******
    -Dhttp.proxyUser=******
    -Dhttp.proxyPassword=******
    in testrunner.bat under JAVA_OPTS=-Xms128m -Xmx384m section.
    When I am trying to run the same test suite directly from TestSuite editor it runs correctly.

    Also when I am trying to run the testsuite from ant script I am facing the same.


    Below is the log from the TestRunner:

    ------------------------------------------

    Running soapUI TestRunner for [NOAA-Weather-Service]

    directory: E:\Installed_Softwares\soapUI-3.5\bin

    command: cmd.exe /C testrunner.bat -sWeatherTestSuite -r -a -j -f E:\Installed_Softwares\soapUI-3.5\TestWorkSpace E:\Installed_Softwares\soapUI-3.5\TestWorkSpace\NOAA-Weather-Service-soapui-project.xml

    soapUI 3.5 TestCase Runner

    Configuring log4j from [E:\Installed_Softwares\soapUI-3.5\bin\soapui-log4j.xml]

    12:32:13,630 INFO [DefaultSoapUICore] initialized soapui-settings from [C:\Documents and Settings\M8070993\soapui-settings.xml]

    12:32:16,177 INFO [WsdlProject] Loaded project from [file:E:/Installed_Softwares/soapUI-3.5/TestWorkSpace/NOAA-Weather-Service-soapui-project.xml]

    12:32:19,145 INFO [SoapUITestCaseRunner] Running soapUI tests in project [NOAA-Weather-Service]

    12:32:19,145 INFO [SoapUITestCaseRunner] Running TestSuite [WeatherTestSuite], runType = SEQUENTIAL

    12:32:21,052 INFO [log] In the WeatherTestSuite Setup Script

    12:32:21,177 INFO [log] In the WeatherTestCase Setup Script

    12:32:21,349 INFO [log] 2010-06-10

    12:32:21,349 INFO [log] 20904

    12:32:21,521 INFO [SoapUITestCaseRunner] Running soapUI testcase [WeatherTestCase]

    12:32:21,567 INFO [SoapUITestCaseRunner] running step [Properties]

    12:32:21,771 INFO [SoapUITestCaseRunner] running step [LatLonListZipCode - Request 1]

    12:32:29,021 ERROR [WsdlSubmit] Exception in request: java.net.ConnectException: Connection refused: connect

    12:32:29,021 ERROR [SoapUI] An error occured [Connection refused: connect], see error log for details

    java.net.ConnectException: Connection refused: connect

    at java.net.PlainSocketImpl.socketConnect(Native Method)

    at java.net.PlainSocketImpl.doConnect(Unknown Source)

    at java.net.PlainSocketImpl.connectToAddress(Unknown Source)

    at java.net.PlainSocketImpl.connect(Unknown Source)

    at java.net.SocksSocketImpl.connect(Unknown Source)

    >>>>>>>>>>>>>>>>>>>>>>>

    ReplyDelete
  10. HI Meera ,
    Its wonderful blog :) , Meera i want to create a WSDL project XML from groovy script ? is it possible to do ?

    ReplyDelete
  11. Chapter 17 of Java Power Tools talks about soapUI.

    ReplyDelete
  12. hi

    could you please suggest me some good books for SOAPUI pro

    Regards
    Kishore.gp

    ReplyDelete
  13. Have any of you worked with composite projects?

    ReplyDelete
  14. Hi Meera , im new to soap ui pro. ur blog is very help full for me thanks a lot. I have a requirement like to send mail with html(JUnit style) reports using the groovy script. is there any help from?

    ReplyDelete