
Meet your instructor, Doug Huff, and start from scratch with hands-on demos in automation, testing, and dev ops, plus tips on captions, transcripts, bookmarks, and adjustable playback.
Learn SoapUI API testing from basics to advanced topics, including setting up SoapUI, creating projects and API requests, and using Groovy scripting, assertions, and Jenkins for version control.
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
__________________________________________________________________________
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
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
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/
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}
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)
}
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 - 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");
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
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 Files\SmartBear\SoapUI-5.4.0\bin\
testrunner.bat -sTestSuite3 -cTestCase2 "C:\Users\Raghav Pal\OneDrive\Projects\SoapUIProjects\CountryInfoService-soapui-project1.xml"
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 Files\SmartBear\SoapUI-5.4.0\bin\
testrunner.bat -sTestSuite2 -j -f"C:\Users\Raghav Pal\Desktop" "C:\Users\Raghav Pal\OneDrive\Projects\SoapUIProjects\CountryInfoService-soapui-project1.xml"
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 Files\SmartBear\SoapUI-5.4.0\bin\
testrunner.bat -j -f"C:\Users\Raghav Pal\Desktop" "C:\Users\Raghav Pal\OneDrive\Projects\SoapUIProjects\CountryInfoService-soapui-project1.xml"
Today we will learn:
--------------------------
1. Different types of logs in SoapUI
2. How to view soapui general and error log file
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)
}
}
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 personal & enterprise projects.
Let's Get Started...