ВУЗ: Не указан

Категория: Не указан

Дисциплина: Не указана

Добавлен: 17.04.2021

Просмотров: 1364

Скачиваний: 2

ВНИМАНИЕ! Если данный файл нарушает Ваши авторские права, то обязательно сообщите нам.
background image

background image

2

SoapUI 

Pro

by 

SMART

BEAR

Introduction ............................................................................................3

Why SoapUI? .................................................................................................... 3

Functional testing ....................................................................................... 3

What is an API? ................................................................................................ 4
What is a Web Service? .................................................................................... 4

SOAP ......................................................................................................... 5
REST ......................................................................................................... 5

Testing APIs ...................................................................................................... 5

No graphical user interface ........................................................................ 5
Request and response ............................................................................... 6

Exploring ........................................................................................................... 6

Getting started .......................................................................................7

Installing ............................................................................................................ 7
Your first project ................................................................................................ 8
Add a test suite ............................................................................................... 13
Add a test ........................................................................................................ 14
Add an assertion ............................................................................................. 17
Run the test..................................................................................................... 19
Run the test suite ............................................................................................ 19
Further exploration .......................................................................................... 20

Create tests .........................................................................................20

Verify a range .................................................................................................. 21
Verify response time ....................................................................................... 25
Verify schema compliance .............................................................................. 25
Go pro: Point and click testing ........................................................................ 26

Verify a range ........................................................................................... 26

Data driven testing...............................................................................28

Go pro: Data source out of the box ................................................................. 29

Create a data source ............................................................................... 29
Create a test with parameters .................................................................. 32
Loop over the data source ....................................................................... 33
Execute the test case ............................................................................... 35
Further exploration ................................................................................... 36

Debugging ...........................................................................................36

Manual ............................................................................................................ 36
Go pro: Test debugging ................................................................................... 36

Multiple environments..........................................................................38

Contents


background image

3

SoapUI 

Pro

by 

SMART

BEAR

Change the target environment ...................................................................... 38
Go pro: Multi-Environment Support ................................................................ 39
Create a test report ......................................................................................... 44

Organize your work .............................................................................46

Workspaces .................................................................................................... 46
Version control ................................................................................................ 46

Why .......................................................................................................... 46
What ......................................................................................................... 47
How .......................................................................................................... 47
Open source or an enterprise system? .................................................... 48

Automation ..........................................................................................48

Run SoapUI test suites without SoapUI .......................................................... 48
Command line ................................................................................................. 48
Maven ............................................................................................................. 49

Add a repository for SoapUI ..................................................................... 50
Add and configure the SoapUI plugin ...................................................... 51
Execute a test from Maven ...................................................................... 52
Properties ................................................................................................. 53
A complete example ................................................................................. 53
More details ............................................................................................. 55

Automate the execution .................................................................................. 55

Conclusion ...........................................................................................56


background image

4

SoapUI 

Pro

by 

SMART

BEAR

Introduction

Why SoapUI?

If you’re unfamiliar with SoapUI, we’ll begin with a short introduction 
to what the tool actually does. SoapUI is an API testing tool that’s both 
free, open source, and cross-platform. With over 1 million downloads it 
has become the de facto standard for functional testing of APIs, allow-
ing you to easily and quickly create automated functional, regression, 
compliance, and security tests.

SoapUI is also available as SoapUI Pro, which includes several time-
saving features aimed at making your testing faster and your testing life 
easier.

Functional testing

While SoapUI’s functionality includes functional testing and security 
testing, as well as service simulation, functional testing is definitely the 
most popular.

Functional testing means checking that the behavior of the system 
under consideration matches the business expectations in terms of 
functionality. SoapUI enables users to perform functional testing easily. 
This is the main functionality of SoapUI.

With SoapUI, you can also perform security testing and service simula-
tion.

You would set up SoapUI to send in requests and specify assertions 
to verify that the response is correct. You would also specify broken 
requests to be able to verify that the application doesn’t blow up when it 
receives that strange and possibly faulty request. These tests can then 
be used as one-off, unit tests, regression tests, etc.

Load testing should be done using LoadUI, which is integrated as a 
component in SoapUI.


background image

5

SoapUI 

Pro

by 

SMART

BEAR

What is an API?

An Application Programming Interface, API, specifies how some soft-
ware components should interact with each other.1

While many people associate APIs with software libraries, the definition 
is broad enough to include Web Services and all types of messaging 
that SoapUI supports: SOAP, REST, JMS, JDBC, AMF and HTTP.

What is a Web Service?

The W3C defines a “Web Service” as:

A Web Service is a software system designed to support interoperable 
machine-to-machine interaction over a network. It has an interface de-
scribed in a machine-processable format (specifically WSDL[sic]). Other 
systems interact with the Web Service in a manner prescribed by its 
description using SOAP-messages, typically conveyed using HTTP with 
an XML serialization in conjunction with other Web-related standards.2

In other words, a Web Service is a service available on a network, that 
will allow other systems to communicate with it, using a defined proto-
col. The Web part indicates that the service is using transport protocols 
designed for the World Wide Web, i.e., it uses HTTP to communicate. 
Other systems can be Web applications, apps in phones and similar.

APIs come in two main flavors, SOAP and REST. Generally, we have 
noticed that when discussing APIs and Web Services, the two terms 
have different connotations, though they technically define the same 
thing. “Web Service” is generally used when discussing SOAP-based 
services, while API is used in a broader sense, encompassing  SOAP, 
REST, and the rest of the API protocols. Therefore, we simply use the 
abbreviation API to refer to the service henceforth.

1 http://en.wikipedia.org/wiki/Application_programming_interface

2 http://www.w3.org/TR/2004/NOTE-ws-gloss-20040211/#webservice