Pages Navigation Menu

Coding is much easier than you think

SOAP UI – Functional Testing – Getting Started…

SOAP UI – Functional Testing – Getting Started…

 
SoapUI is the Swiss-Army knife of automated Functional and Regression Testing. Powerful and innovative features help you validate and improve the quality of your services and applications. Best of all, you don’t have to be a developer to write Functional Tests in SoapUI. So whether you’re creating new TestSuites, adding TestCases, or adding assertions to your TestCases, it’s all amazingly simple and easy.

In this tutorial, let’€™s see how to add a request to the test suite and a test case and run the request from within the test suite.

Before starting this tutorial, create a new project using a WSDL in SOAPUI as discussed in the previous tutorials.
 
** Update – Complete SoapUi Tutorials now available here
 
Follow the steps below to run the request using a test suite.

Step 1: In the project created click on the request name as shown in the image below.

Click Project Request

 

Step 2: Click on add request to testsuite icon  (Add request to test case) icon as shown in the image above in the request window.

Step 3: Create TestSuite window appears as shown below.

 

New TestSuite

 

Step 4: Enter a test suite name of your choice and click on OK.

TestSuite name

Step 5: Enter user defined test case name in the Create TestCase window as shown in the image below and click on OK.

New Testcase


TestCase name

 

Step 6: In the Add request to test case enter a user defined name and click on OK.

Add request dialog

Step 7: Thus the request is successfully added to the testcase in a testsuite as shown in the image below.

Request in TestSuite

ADD ASSERTION:

Follow the steps below to add assertion to a request.

Step 1: Click on the icon  Add assertion icon (Add assertion to the request) as shown below to add an assertion in your request window.

Add assertion to request

 

Step 2: This will display Add Assertion window as shown below.

add assertion dialog

 

As you can see in the above image, there are various types of assertions that can be added to validate your response.

The various types of assertions are discussed in detail in types of assertions tutorial. Let’€™s add SLA assertion for the request in this tutorial using the step by step procedure mentioned below.

Step 3: Click on SLA assertion and select Response SLA option to validate the response time for the request sent.

select assertion

 

Step 4: Thus SLA assertion is added successfully as shown in the image below. To see the assertions, available for a request click Assertions tab at the bottom of the request window.

Assertion added

Note: Before running the request for SLA assertion, set the response time limit for the assertion by double clicking on the assertion as shown in the image below.

RUN a Request:

Note: There are many ways of running a request.

In this tutorial, we will see

  • How to run the request directly?
  • How to run at testcase level?

Run the request directly:

Step 1: Now that an assertion is added, you can validate your response using the assertion by running the request directly clicking on RUN.

Assertion- VALID:

Valid assertion

Assertion – FAILED:

Assertion failed

 

Run the request at TestCase level:

Step 1: Click on the TestCase name to open the testcase window and click on RUN to run the testcase request as shown below.

Run at testsuite level

VALID Assertion:

Valid assertion

Invalid Assertion:

Assertion invalid