4.4 out of 5
4.4
32 reviews on Udemy

SOAPUI API Testing | Step by Step for Beginners

learn SoapUI from scratch
Instructor:
Raghav Pal
2,015 students enrolled
English [Auto-generated]
Use SoapUI open source for API testing
Create manual and automation frameworks in SoapUI
How to use Groovy scripts
How to handle different api testing needs

In this course we will go very basic, step by step and learn SoapUI from scratch.
All the sessions are created on SoapUI open source version.

This course will cover:

1. What is SoapUI
2. Download and Getting Started
3. Understand the GUI and features
4. Create First SoapUI project
5. Learn about Project, TestSuite, TestCases and TestSteps
6. Assertions
7. Properties
8. Groovy Scripts
9. Command line execution
10. CI Jenkins

Do not worry if you have no prior knowledge of API Testing or SoapUI.
This course will teach you all you need for working on API Testing with SoapUI for any enterprise projects.

Let’s Get Started…

DISCOUNT COUPON CODE – SOAPUI_DISCOUNT

INTRODUCTION

1
Introduction & Getting Started

Today we will learn:

1. What is SoapUI
2. Why to use SoapUI
3. How to Download and Install SoapUI
4. Difference between SoapUI Open Source and Paid versions

What is SoapUI
---------------------
API Testing Tool
For manual and automation testing of SOAP and REST APIs

Why to use SoapUI
-------------------------
1. To create quick and efficient API tests
2. To create API functional, performance and security tests
3. To create API Testing automation framework

Step 1 : Download SoapUI from - https://www.soapui.org/downloads/latest-release.html

Step 2 : Install SoapUI

__________________________________________________________________________

2
Features & GUI

Today we will learn:

1. GUI components of SoapUI

2. Menu and Icons

3. Configurations

Cross platfrom tool

Built entirely over Java platform

uses Swing for GUI

Project > Test Suite > Test Case > Test Step

Project Navigator

Request Editor

Response Editor

Sample REST URI - http://thomas-bayer.com/sqlrest/CUSTOMER/10

First Project

1
How to create First SOAP Project

Today we will learn:

1. How to create a SOAP API Project
2. How to add WSDL
3. How to create Test Suite > Test Cases
4. How to add Assertions
5. Run Test Step > Test Case > Test Suite
6. How to run in sequence and in parallel
7. How to create API Documentation

WSDL - http://webservices.oorsprong.org/websamples.countryinfo/CountryInfoService.wso?wsdl

2
How to create First REST Project

Today we will learn:

1. Create a REST Project
2. Add a REST request 
3. How to add request parameters
4. Create a Test Case
5. Add assertions
6. Run and Validate

URI - Uniform Resource Identifier REST Endpoints - https://restcountries.eu/

Properties

1
Properties | Introduction

Today we will learn:

1. What is property in soapui

2. Why do we use it

3. How to create properties at different levels

4. How to refer properties

Properties can be used as variables to store values that can be referred in testing

Properties can be accessed at following levels:

Project       - ${#Project#PropertyName}

TestSuite   - ${#TestSuite#PropertyName}

TestCase   - ${#TestCase#PropertyName}

TestStep    - ${TestStepName#PropertyName}

System   - ${#System#PropertyName}

Env        - ${#Env#PropertyName}

Global    - ${#Global#PropertyName}

2
How to handle Properties with Groovy Scripts

Today we will learn:

1. How to get property

2. How to set property

3. How to add property

4. How to remove property

5. How to loop through all properties

References

https://www.soapui.org/scripting-properties/tips-tricks.html

Notes

// Get and Set Property

//Project

testRunner.testCase.testSuite.project.getPropertyValue("Name")

testRunner.testCase.testSuite.project.setPropertyValue("Name","I am in Project")

//TestSuite

testRunner.testCase.testSuite.getPropertyValue("Name")

testRunner.testCase.testSuite.setPropertyValue("Name","I am in TestSuite")

//TestCase

testRunner.testCase.getPropertyValue("Name")

testRunner.testCase.setPropertyValue("Name","I am in TestCase")

//TestStep

testRunner.testCase.getTestStepByName("CountryCodes").getPropertyValue("Name")

testRunner.testCase.getTestStepByName("CountryCodes").setPropertyValue("Name","I am in Test Step")

//Global

com.eviware.soapui.SoapUI.globalProperties.getPropertyValue( "Name")

com.eviware.soapui.SoapUI.globalProperties.setPropertyValue( "Name","I am in Global Prop" )

// Add Property

testRunner.testCase.testSuite.project.addProperty("DOB")

// Remove property

//Project

testRunner.testCase.testSuite.project.removeProperty("Name");

//TestSuite

testRunner.testCase.testSuite.removeProperty("Name")

// Loop through properties

testRunner.testCase.properties.each

{

key,value ->

log.info (testRunner.testCase.getPropertyValue(key))

//log.info (key+" - "+value)

}

3
How to do Property Transfer

Today we will learn:

1. How to send values from response of one api to request of another api

Steps shown in video

Groovy Scripting

1
Groovy Scripting | Getting Started

GROOVY Scripting - Getting Started
------------------------------------------------

Today we will learn:
------------------------
1. What is Groovy
2. How to add groovy scripts in SoapUI
3. How to do basic coding in groovy in SoapUI
4. Basic Object Oriented Programming. (Classes and Objects)

References
https://en.wikipedia.org/wiki/Apache_Groovy
https://www.soapui.org/apidocs/com/eviware/soapui/model/testsuite/TestRunner.html

Code Snippets
=============
import java.io.*;

log.info ("        Hello World ...  ");

int a = 10 ;
int b = 20 ;
int c = a+b ;
log.info ("   Result is : "+c) ;

// this is a single line comment

/*
 * This is
 * multiline comment
 */

 //log
 //context
 //testRunner

log.info testRunner.metaClass.methods*.name.unique().sort()

======================

class Hello{

def log;
def context;
def testRunner;

def Hello(log, context, testRunner){
this.log = log
this.context = context
this.testRunner = testRunner
}

def sayHello(String name){
log.info ("   Hello "+name);
}

}

context.setProperty("Hello", new Hello(log,context,testRunner))

========================

def testStep = testRunner.testCase.getTestStepByName("Hello")

testStep.run(testRunner, context)

context.Hello.sayHello("Raghav")

============================

project = testRunner.testCase.testSuite.project ;
 tcase = project.testSuites["TestSuite3"].testCases["TestCase1"] ; 
 hello = tcase.getTestStepByName("Hello");

hello.run(testRunner, context)

context.Hello.sayHello("Raghav")

project = testRunner.testCase.testSuite.project ;
 tcase = project.testSuites["TestSuite"].testCases["TestCaseName"] ; 
 hello = tcase.getTestStepByName("Hello");

log.info testRunner.metaClass.methods*.name.unique().sort()

context.setProperty("Hello", new Hello(log,context,testRunner))

def hello = testRunner.testCase.getTestStepByName("Hello");

hello.run(testRunner, context)

def ref = context.Hello;
ref.printHello("Raghav");


Running Requests

1
How to run a Request

Today we will learn:

1. How to run a request or step from GUI
2. How to run a request or step from Groovy
3. Options for command line runs

Useful TIPS

//Groovy - run request from same TestCase
def status = testRunner.runTestStepByName("TestStepName")
def result = status.getStatus().toString();
log.info ("   >>>   "+result)

//Groovy - run request from another TestCase or TestSuite
project = testRunner.testCase.testSuite.project ;
tcase = project.testSuites["TestSuiteName"].testCases["TestCaseName"] ; 
tstep = tcase.getTestStepByName("TestStepName");
def status = tstep.run(testRunner, context)
def result = status.getStatus().toString();
log.info ("   >>>   "+result)

https://www.soapui.org/docs/functional-testing/teststep-reference/run-testcase.html

2
How to run a Test Case|GUI, Groovy and Command Line

How to run a Test Case - from GUI, Groovy and Command Line
------------------------------------------------------------------------------------

Today we will learn:
-------------------------
1. How to run a Test Case from GUI
2. How to run a Test Case from Groovy
3. How to run a Test Case from  

Useful TIPS
---------------
How to get list of all TCs in a test suite
Get TestCaseName - testRunner.testCase.name

Notes:
groovy code to run test case
=====================
def tCase = testRunner.testCase.testSuite.testCases["TestCaseName"]
runner = tCase.run(new com.eviware.soapui.support.types.StringToObjectMap(), false);

groovy code to loop test cases in a test suite
==================================
def testCases = context.testCase.testSuite.getTestCaseList() 
testCases.each{
log.info(it.name)
}

command line run
==============
cd C:Program FilesSmartBearSoapUI-5.4.0bin
testrunner.bat -sTestSuite3 -cTestCase2 "C:UsersRaghav PalOneDriveProjectsSoapUIProjectsCountryInfoService-soapui-project1.xml"

3
How to run a Test Suite | GUI, Groovy and Command Line

Today we will learn:

-------------------------
1. How to run a TestSuite from GUI
2. How to run a TestSuite from Groovy
3. How to run a TestSuite from CommandLine

Groovy script
-------------------
def suite = context.testCase.testSuite.project.testSuites["TestSuiteName"]
suite.run(null,false)
// null can be replaced with : new com.eviware.soapui.support.types.StringToObjectMap()
log.info ("   >>>   "+suite.getName().toString()+" - Executed successfully")

command line run
-----------------------

cd  C:Program FilesSmartBearSoapUI-5.4.0bin
testrunner.bat -sTestSuite2 -j -f"C:UsersRaghav PalDesktop" "C:UsersRaghav PalOneDriveProjectsSoapUIProjectsCountryInfoService-soapui-project1.xml"

4
How to run a Project | GUI, Groovy and Command Line

Today we will learn:
-------------------------

1. How to run a Project from GUI
2. How to run a Project from Groovy
3. How to run a Project from CommandLine

groovy script
------------------
def projectName=testRunner.getTestCase().getTestSuite().getProject().getWorkspace().getProjectByName("REST Project 1")
projectName.run(null,true)
//projectName.run(new com.eviware.soapui.support.types.StringToObjectMap(), false)

command line run
--------------------------
cd C:Program FilesSmartBearSoapUI-5.4.0bin
testrunner.bat -j -f"C:UsersRaghav PalDesktop" "C:UsersRaghav PalOneDriveProjectsSoapUIProjectsCountryInfoService-soapui-project1.xml"

LOGS

1
Logs in SoapUI

Today we will learn:
--------------------------
1. Different types of logs in SoapUI
2. How to view soapui general and error log file

SetUp & TearDown

1
SetUp & TearDown in SoapUI

Today we will learn:
--------------------------

1. What is SetUp and TearDown
2. Why to use it
3. How to use SetUp and TearDown scripts in SoapUI
4. How to set SetUp and TearDown with groovy scripts

Setup - runs before running the element in context
Teardown - runs after running the element in context

groovy code to set and get setup and teardown scripts 
--------------------------------------------------------------------------
testRunner.testCase.testSuite.project.getTestSuiteByName('TestSuite1').getTestCaseByName('TestCase1').setSetupScript('log.info "setup"')
testRunner.testCase.testSuite.project.getTestSuiteByName('TestSuite1').getTestCaseByName('TestCase1').setTearDownScript('log.info "teardown"')

log.info ("  >>  "+testRunner.testCase.getSetupScript());
log.info ("  >>  "+testRunner.testCase.getTearDownScript());

groovy code can be given at project load script to load setup and teardown scritps from file
--------------------------------------------------------------------------------------------------------------------------
def su = new File("setup.txt").text
def td  = new File("teardown.txt").text

project.getTestSuiteList().each { testSuite ->
 testSuite.getTestCaseList().each { testCase ->
  testCase.setSetupScript(su)
  testCase.setTearDownScript(td)
 }
}

Assertions

1
Assertions | Introduction

Assertions - Introduction
-----------------------------------

1. What are assertions
2. Why do we add assertions
3. Diff types of assertions in SoapUI

ASSERTIONS - validations on response

expected vs actual

REST - https://restcountries.eu/
SOAP - http://webservices.oorsprong.org/websamples.countryinfo/CountryInfoService.wso?WSDL

2
Assertions | How to add different assertions in SoapUI

Today we will learn

How to add different assertions in SoapUI

Contains 
XPath Match
XQuery Match
Compliance
JSON Path assertions

SLA - SERVICE LEVEL AGREEMENT

JSON PATH FINDER - chrome-extension://bankcpekihijigplompggpdolehhnale/index.html

3
Assertions | How to create script assertion (with groovy)

Today we will learn:

1. What is Script Assertion
2. How to add Script Assertion
3. Different assertion scripts for xml and json messages
4. Tips and Tricks
  

Script assertion works on the last reponse received in soapui
works with messageExchange object
(messageExchange object stores all the details of the last request and response)

Script Assertion samples
=====================

//check response time
assert messageExchange.timeTaken < 4000

//check for Endpoint
 log.info messageExchange.getEndpoint() 

//check for TimeTaken
 log.info messageExchange.getTimeTaken()  

//check for header
log.info (messageExchange.responseHeaders["Content-Length"])
assert messageExchange.responseHeaders["Content-Length"] != null

//check attachments
assert messageExchange.responseAttachments.length == 0
log.info (messageExchange.responseAttachments.length)

//validate response nodes
def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context )
def requsetHolder = groovyUtils.getXmlHolder( messageExchange.requestContent )
def responseHolder = groovyUtils.getXmlHolder( messageExchange.responseContent )
def refNum = responseHolder.getNodeValue("//m:CountryCurrencyResult/m:sName")
assert responseHolder.getNodeValue("//m:CountryCurrencyResult/m:sName") == "Rupees"

//to get response
def resp = messageExchange.responseContentAsXml.toString()

For JSON response
---------------------------

//get json response
import groovy.json.JsonSlurper
def responseMessage = messageExchange.response.responseContent
def json = new JsonSlurper().parseText(responseMessage)

//assert node values
log.info json.name
assert json.capital.toString() != null
assert json.name.toString() == "[Taiwan]"

testStepName = messageExchange.modelItem.testStep.name//to get the Test Step Name
log.info testStepName
xmlHold = messageExchange.responseContentAsXml.toString()  //to store the response as Xml string

JENKINS CI

1
How to run SoapUI tests from Jenkins

Today we will learn:

1. How to get Jenkins
2. How to add SoapUI commands in Jenkins
3. How to run SoapUI tests from Jenkins

Step 1 : Open SoapUI and goto the test case

Step 2 : Right click and select Launch Test Runner

Step 3 : Run from Test Runner and copy the commands

cd C:Program FilesSmartBearSoapUI-5.4.0bin
testrunner.bat -sTestSuite1 -cAssertions "C:UsersRaghav PalOneDriveProjectsSoapUIProjectsREST-Project-1-soapui-project.xml"

Step 4 : Get Jenkins on your system

Step 5 : Run jenkins - java -jar jenkins.war --httpPort=xxxx

Step 6 : Create a new job and add details

Step 7 : Run the job and validate results

References:
Jenkins download - https://jenkins.io/download/

cd C:Program FilesSmartBearSoapUI-5.4.0bin
testrunner.bat -sTestSuite1 -cAssertions "C:UsersRaghav PalOneDriveProjectsSoapUIProjectsREST-Project-1-soapui-project.xml"

API MONITORING

1
How to create API Monitors

Today we will learn:

1. How to setup API Monitors
2. How to Monitor APIs in SoapUI

What is API Monitoring:
Checking of your APIs at regular interval for 
Availability
Correctness
Performance

Step 1 : Open SoapUI > Right click on Project and Select - Monitor APIs

Step 2 : Connect to AlertSite (SignUp | SignIn)

Step 3 : Create Monitors

Step 4 : Add APIs to monitor and view in AlertSite

References :
https://smartbear.com/lp/alertsite/free-api-monitoring/

GIT Version Control

1
How to add SoapUI Project to GIT (version control system)

Today we will learn:

1. Install git on windows
2. Create GitHub account
3. Add SoapUI Project on Git
4. Add, commit, push Changes
5. Remove project from Git

Step 1 : Download and Install Git

Step 2 : Create GitHub account

Step 3 : Add SoapUI Project to Git
Goto Command Prompt
Goto location of SoapUI Project
git init
git status
git add .
git commit -m "commit message"
git push -u url master

Step 4 : Validate changes are pushed to repository

Step 5 : Remove project from Git

References:
https://git-scm.com/download
https://help.github.com/articles/setting-your-username-in-git/

GROOVY Snippets | TIPS & TRICKS

1
Groooy Scripts 1 | Test Steps

Today we will learn:

1. Access any test step within the same test case
2. Access property of any Properties step within the same Test Case.
3. Access step from any other TestSuite / TestCase
4. Get list of all steps in a test case
5. Run TestStep of another TestCase

Groovy Snippets
=============

//How to access any test step within the same test case
testRunner.testCase.getTestStepByName("CountryCurrency");

//How to access property of any Properties step within the same Test Case.
testRunner.testCase.getTestStepByName("Properties").getPropertyValue("Name");

//How to access step from any other TestSuite / TestCase
 project = testRunner.testCase.testSuite.project ;
 tcase = project.testSuites["TestSuite2"].testCases["Assertions"] ; 
 tstep = tcase.getTestStepByName("MyProperties");
 tstep.getPropertyValue("Location")
 tstep.setPropertyValue("Location","US");
 tstep.getPropertyValue("Location")

 //Get list of all steps in a test case
 // This will get the list of all testSteps in the testCase
def testSteps = context.testCase.getTestStepList() 
testSteps.each{
// This block will loop through the test steps and print the test step name to the log
log.info(it.name)
}

//Run TestStep of another TestCase
def tCase = testRunner.testCase.testSuite.testCases["TestCase1"]
def tStep = tCase.testSteps["CountryCurrency"]
tStep.run(testRunner, context)

________________________________________________________________

2
Groovy Scripts 2 | Get Response Values

Today we will learn:

1. How to fetch response with groovy scripts

2. How to get value from a node

def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context )def holder = groovyUtils.getXmlHolder( "ReqName#Response" )

for( item in holder.getNodeValues( “xPath” ))
log.info "Name : $item"

BONUS | Web Services for Beginners

1
What is a Web Service

Today we will learn

———————————
1. What is a web service
2. Basic concept behind web services
3. Why we use it
_____________________________________________

What is a Web Service:
Web Service - service available over the web
   - enables communication between applications over the web
   - provides a standard protocol/format for communication

Why we use it:
   - platform independent communication
   - using web services two different applications (implementation)  can talk to each other and exchange data/information

_______________________________________________________

Difference between api and web services

https://stackoverflow.com/questions/19336347/what-is-the-difference-between-a-web-api-and-a-web-service

2
How Web Services work

Today we will learn

1. Basic concepts of working of web services 
2. Client Server model 
3. Types of WS - SOAP and REST (overview)


3
What is WSDL and UDDI

Today we will learn

1. Components of Web Services : WSDL and UDDI

4
What are SOAP Web Services

Today we will learn:

1. What is a Soap Web Service
2. Soap Web Services Specifications/Components

5
What are REST Web Services (Part-1)

Today we will learn:

1. What is REST
2. Basic architecture of REST
3. What are RESTful Web Service
4. Constraints of REST - Uniform Interface

6
What are REST Web Services (Part-2)

Today we will learn:

Principles of REST

A. Uniform Interface  
1. Resource  
2. URI  
3. HTTP

B. Stateless
C. Cacheable
D. Layered System
E. Code-On-Demand

You can view and review the lecture materials indefinitely, like an on-demand channel.
Definitely! If you have an internet connection, courses on Udemy are available on any device at any time. If you don't have an internet connection, some instructors also let their students download course lectures. That's up to the instructor though, so make sure you get on their good side!
4.4
4.4 out of 5
32 Ratings

Detailed Rating

Stars 5
11
Stars 4
13
Stars 3
6
Stars 2
2
Stars 1
0
4ba97300a7434dd72a5a3d8fda9658ac
30-Day Money-Back Guarantee

Includes

5 hours on-demand video
Full lifetime access
Access on mobile and TV
Certificate of Completion