Methods & Tools Software Development Magazine

Software Development Magazine - Project Management, Programming, Software Testing

 

Click here to view the complete list of tools reviews

This article was originally published in the Fall 2010 issue of Methods & Tools


SoapUI

Axel Irriger, cirquent GmbH, http://www.cirquent.de

SoapUI is an application and framework to simplify the testing of web applications and web services. Test cases can be entered using a graphical user interface. They can be executed either by using the graphical user interface or in an embedded fashion with either Apache Ant or Apache Maven.

Web Site: http://www.soapui.org or http://sourceforge.net/projects/soapui/
Version Tested: soapUI 3.5 on Windows XP with Java 1.6.0_20
License & Pricing: Open Source and Commercial License available
Support: Forums and web site, various resources on the net

Installation

The soapUI distribution can be downloaded from http://www.soapui.org. The distribution is a compressed archive, which contains an automatic installer. Binary distributions exist for Microsoft Windows, Linux, MacOS and Solaris.

After installation, it can be started and presents itself with the graphical user interface (see Figure 1).

Figure 1 soapUI 3.5 Graphical User Interface

Configuration

The work with soapUI is organized around a project (see Figure 2). As you can see from the dialog, you have the option to directly add a web service description (WSDL) file, if you are to test a web service. Nevertheless this is not necessary, especially if you test a web application.

Figure 2 New Project Dialog

If you enter a WSDL, you can instantly create sample requests from the defined XML schema, a test suite for all the operations in the service and a mock, which simulates the real service.

Figure 3 New TestSuite dialog

Within a project, you can have several test suites, which are a logical group of similar test cases (see Figure 3). The definition of "logical group" is nonetheless up to you. In some cases, it's enough to have one test suite for a whole application; in other cases it might be necessary to define a test suite per application use case. However you define your structure, the surrounding container always is the project. Therefore, it's a good idea to store the soapUI project definition alongside the application or service under test.

Within each test suite are one or more test cases. Each test case is to test exactly one functional artifact.

Figure 4 Supported test steps

A test case is a sequence of steps, being carried out by soapUI (see Figure 4). Since functional testing and load testing are two separate things, you can either add load test steps or functional test steps. While being possible, you are not advised to mix both, since it complicates readability.

Each step you define is mapped to an action, which is carried out by soapUI. Such an action can be the invocation of a HTTP URL, to load a web page, or the transfer of portions of one response document to a new request (for instance, to carry along a session ID).

Figure 5 Some supported assertions

For each test step, it is possible to add assertions. An assertion is a check of an expected value against a found one. That is, after logging in to a web site, there is often some sort of greeting for the user. If you know (which you do), with which user you are logging in, you can check whether this particular greeting is present.

Besides such pure functional assertions, non-functional assertions are possible in terms of page load duration.

Figure 6 New MockService dialog

Since it is not always the case that you have direct access to the web service you are testing, soapUI supports using a mock, which can be automatically created, when creating a new project (see Figure 6). This mock offers all operations but can be populated with pre-defined responses for requests and simulates the web service behavior.

When your test case and test suite are populated, it is also possible to save this configuration set to a XML file. That way, not only regression testing is possible but also test automation.

When your project definition is done, you can see everything in the project overview.

Figure 7 Project Overview

From here, you can see under the first section "WeatherSummary" automatically generated requests from the WSDL schema definition. The section "WeatherSummary TestSuite" is an automatically generated test suite, which contains tests for each operation of the service. The third section ("WeatherService MockService") contains the mock service, which is created for all operations. For each operation you can define one or more responses, which are sent to the client in case of XPath assertions or a simple invocation counter.

Automating SoapUI

soapUI comes with a graphical user interface, which is great for daily usage and the definition of test suites. To actually execute tests, it is possible to either use the GUI used in test suite creation or to embed the test execution with Apache Ant or Apache Maven. This way, the test suite can be stored alongside the application in the version control repository and reused in a continuous integration environment,

Plugins for SoapUI

The soapUI approach is to provide not only a test application but a test framework. This framework can be extended using the provided API.

Within the core web-enabled stack, loadUI is quite helpful, as it supports load testing a web site. There is also a plugin for testing REST (REpresentational State Transfer) web services. These are, in contrast to SOAP web services, centered around the URL, which describes the objects to operate on and the action to invoke and not the body document.

Web services are often not only used via HTTP, but also via JMS (Java Messaging System). For that transport mechanism, integration with HermesJMS is present.

Taking a step back from the web space, soapUI also delivery various plugins for other test purposes, such as JDBC (Java DataBase Connectivity). They use the graphical user interface of soapUI to simplify test creation.

Documentation and Literature

The quite extensive documentation for soapUI is available on its web site, http://www.soapui.org. Also, eviware as the primary developer of soapUI, supports with community and "pro" forums.

Summary and Conclusion

The testing space is always in the move and soapUI is no exception. Coming from the testing of web applications and web services, the framework now supports a lot more. When focusing on web applications, it provides all relevant operations needed to replay whole web site conversations. The web service stack is well supported with SOAP and REST based services, the ability to invoke XML schema validations for SOAP web services and XPath queries on any XML document.

Besides that, other operations, such as JDBC, can be integrated in a test as well. This flexibility, combined with a simple and functional graphical user interface, makes soapUI a highly recommendable test tool, which should also be considered for integration with a test automation framework, such as Hudson CI.


More Load Testing and Software Testing Content


Click here to view the complete list of tools reviews

SpiraTeam Agile ALM


Agile Alliance Technical Conference

SQE Live Virtual Training