SOAP UI

Contents
Introduction
Creating a Test Suit in SOAP UI
Assertions in SOAP UI
XPath Match Assertion
Install SOAP UI in Linux
Related Articles

Introduction

What is this article about?

In this article, you will learn about what SOAP UI is and see some use cases.

If it is easier for you to study the material from the simplest to the most complex, I recommend it. First, read the first few pages of my book. here

SoapUI is an open-source web service testing application for service-oriented architectures (SOA) and representational state transfers (REST).

Its functionality covers web service inspection, invoking, development, simulation and mocking, functional testing, load and compliance testing.

A commercial version, SoapUI Pro, which mainly focuses on features designed to enhance productivity, was also developed by Eviware software.

In 2011, SmartBear Software acquired Eviware.

SoapUI was initially released to SourceForge in September 2005. It is free software, licensed under the terms of the European Union Public License.

Since the initial release, SoapUI has been downloaded more than 2,000,000 times.

It is built entirely on the Java platform, and uses Swing for the user interface. This means that SoapUI is cross-platform.

Today, SoapUI also supports IDEA, Eclipse, and NetBeans.

SoapUI can test SOAP and REST web services, JMS, AMF, as well as make any HTTP(S) and JDBC calls.

SOAP UI image from www.eth1.ru

How to send requests

New REST Project → Write URI. → The request is created, you can add new ones.

The method can be selected from the drop-down list.

The project has a hierarchical structure.

Project → Service → Resource → Method → Request

The names reflect the essence of:

Request A request is a place where you can change the body of the request and See the server's response. To send requests, press the green triangle.

Method (method) indicates GET, POST, PUT or any other method you use. All child requests They will have the same method.

Resourse Resource is responsible for the part of the URL that is added to the base URL.

Service (Service) is responsible for the basic part of the URL

How to save projects

Besides using «Save all projects», I advise closing all new windows manually. Then SOAP UI will ask you to save each project separately.

After everything New projects are saved, you can close SOAP UI. I try to shut down SOAP UI only. When all the windows are closed.

Creating a Test Suit in SOAP UI

Shortly:

→Right Click on your Project

→ Create New TestSuit (CTRL + T)

→ Specify name of TestSuit

→ Right Click on your TestSuit

→ New TestCase (CTRL + N)

→ Specify name of TestCase

→ Expand Test Case

→ Click on Test Steps

→ Add Step

→ Choose request (e.g. SOAP Request)

→ Specify name for new step

→ Select operation to invoke for request

→ Add Request to TestCase (OK)


Green «+» icon will appear. By clicking it you can add Assertions.

Details:

SOAP UI New Test Suite Right Click Project Image from www.eth1.ru
Right click on the project name

Create New TestSuit (CTRL + T)

Specify name of TestSuite image from www.eth1.ru
Specify the name for TestSuit

→ Right-click on TestSuit

New TestCase image from www.eth1.ru
New TestCase (CTRL + N)
Specify name of TestCase image from www.eth1.ru
Specify the name for TestCase

→ Expand Test Case

→ Click on Test Steps

→ Add Step

→ Select the request (e.g. SOAP Request)

→ Specify the name for the new step

→ Select the operation that triggers the request

→ Add Request to TestCase (OK)


Green «+» the plus icon will appear at the top. By clicking on it, you can add Assertions.

Assertions at SOAP UI

Assertions are added to the TestSuits so to be able to add Assertions you need to create at least one TestSuit and click the green + sign.

SOAP UI assertion types image from www.eth1.ru

Then you can choose one of the wide variety of available assertion types.

SOAP UI assertion types image from www.eth1.ru

Property Content → Contains

ChooseContains. With this assertion it will be possible to search for the existence of a string token in the property value. It supports regular expressions and is applicable to any property.

Specify unique name of Assertion

SOAP UI assertion types image from www.eth1.ru

Type in content that you expect to receive in case of successfull request

Contains Assertion image from www.eth1.ru

Property Content → Not Contains

Choose Not Contains. With this assertion it will be possible to search for the non-existence of a string token in the property value. It supports regular expressions and is applicable to any property.

Specify unique name of Assertion

SOAP UI assertion types image from www.eth1.ru

ype in content that you definitely do not want to receive in the response

Contains Assertion image from www.eth1.ru
Banner image

Compliance, Status and Standards

SOAP Response

Choose SOAP Response. With this assertion you can check that the last received response is a valid SOAP Response. It is applicable only to SOAP TestRequest Steps only. Do not try to use it with REST.

Double click on the Assertion. It does not require any additional parameters and can be added to the test step only once.

SOAP Request assertion image from www.eth1.ru

Compliance, Status and Standards

Valid HTTP Status Code

Choose Valid HTTP Status Code. With this assertion you can check that the last received response is a valid SOAP Response. It is applicable only to SOAP TestRequest Steps only. Do not try to use it with REST.

Valid HTTP Status Code assertion image from www.eth1.ru

Type in the HTTP Status Codes that are appropriate for your request.

Usually it is 200 but you need to read system specification to be sure.

Valid HTTP Status Code assertion image from www.eth1.ru

SLA → Response SLA

Choose Response SLA. With this assertion you can validate that the last received response time was within the defined limit. It is applicable to Script TestSteps And TestSteps that send requests and receive responses.

Response SLA assertion image from www.eth1.ru

Specify the maximum response time (ms)

If response time is not mentioned in the spec add some reasonable time.

Specify the maximum response time soap ui response assertion image from www.eth1.ru
Banner image

Property Content → XPath Match

Choose. XPath Match. This Assertion uses the XPath expression to select the content of the specified object. Compare the result with the expected value.

It can be applied to any object that contains XML.

Press Declare.

To confirm that the necessary data are present in the answer, write exists (//the data to come )

In the field Expected Result write true.

Specify XPath expression and expected result image from www.eth1.ru

To check not the presence as such, but the value of some quantity. enter XPath Expression Either the full path to the size or its name.

And the value you expect to get enter in the field Expected Result.

Specify XPath expression and expected result image from www.eth1.ru

If, for example, we cannot connect to the server and all our assertions They will have red indicators.

SOAP UI failed assertions image from www.eth1.ru

Imitation service

How to create a service simulation (mock-service) You can read it in the article. Mock Service

Do you need SOAP UI??

The answer to this question depends on your level of training, preferences, and I mean, ideology.

A novice SOAP UI tester will be useful at least because it is stored and created. It is easier and faster than other methods.

A tester with programming experience, such as Python You can write all the necessary scripts yourself.

Ideological adherents of work from the console or only from Linux It may also seem that SOAP UI has too many UIs.

Installation of SOAP UI in Linux

Please note that you need to pre-install Java (JRE).

How to install Java read here

There is an official instruction, but if you want to save time and nerves…

Cross over. loading page.

Download installer. Copy in the appropriate directory, for example, in /opt. Unpacking.

tar -zxvf SoapUI-5.4.0-linux-bin.tar.gz

Go to the directory SoapUI-5.4.0/bin

sh soapui.sh

Article author: Andrei Olegovich

Related articles
Testing
Education
Lessons
API Testing
Automation
Theory
Mock Service with SOAP UI
List of open API

Search this site

Subscribe to Telegram channel @aofeed to follow new articles and updates to old ones

Go to channel

@aofeed

Ask a question in the Telegram group

@aofeedchat

Contacts and cooperation:
I recommend our hosting beget.com
Write to info@aredel.com if you:
1. Want to write an article for our site or translate an article into your native language.
2. Want to place thematically relevant ads on the site.
3. Ads on my site pass maximum censorship. If you see an ad block unsuitable for school-age children, shocking or misleading - please contact us by e-mail
4. Found a mistake, inaccuracy, bug, etc. on the site. ... .......
5. Articles can be shared on social media by clicking a network icon: