SlideShare ist ein Scribd-Unternehmen logo
1 von 63
Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL
API Testing in SoapUI
By
Razia Sultana
25-01-2018
Knowledge Sharing Session
Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 2
Agenda
1. API
2. RESTful API
3. Difference between SOAP and REST
4. SoapUI: Introduction and Features
5. SoapUI: Download, Installation, Configuration
6. SoapUI: Create a SOAP Project, Test Suite, Test Case
7. SoapUI: Assertions
8. Functional Testing
9. Load Testing
10.Security Testing
11.API testing
12.MockService
13.Reports
Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 3
API Testing
(API) Application Program Interface that is sharing data from a
program with another program.
For example: Like bell mark / canon, company made a printer for printing but they did not make
Microsoft word. How does Microsoft word print on that printer? There is definitely a relationship
between Microsoft and Canon.
Actually there is no relation between application software or printer/Canon. Two programs
communicate using an interface or medium. This medium is called API.
When have a print command in Microsoft
Word, he requests the printer status to the API,
and if all is correct, then print the document to
the API. The API asks the printer to print the
document. The printer needs to know exactly
what a program is asking to print, when a
document arrives near the printer, the printer
will read it and print it.
Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 4
RESTful API Testing
(RESTful API) When Web services use REST (REpresentational state transfer)
architecture, they are called RESTful API that uses HTTP requests to GET, PUT, POST and
DELETE data.
HTTP Methods
GET: The GET method is used to retrieve data from a server at the specified resource.
POST: requests are used to send data to the API sever to create or update a resource.
PUT: requests are used to send data to the API to create or update a resource.
DELETE: method is exactly as it sounds: delete the resource at the specified URL.
The REST style emphasizes the interactions
between clients and services. REST is an
alternative to SOAP (Simple Object Access
Protocol) and instead of using XML for
request REST uses simple URL in some
cases.
Rest API supports both XML and JSON
format.
Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 5
SOAP and REST - Compared
SOAP REST
1. Simple Object Access Protocol. 1. Representational State Transfer.
2. A XML based message protocol. 2. An architectural style protocol.
3. Uses WSDL for communication between
consumer and provider.
3. Uses XML & JSON to send and receive
data.
4. Invokes service by calling RPC method. 4. Simply calls via URL path.
5. Does not return human readable result. 5. Result is readable which is just plain
XML or JSON.
6. Transfer is over HTTP, SMTP or FTP
protocol.
6. Transfer is over HTTP only.
7. Javascript can call SOAP but it is difficult
to implement.
7. Easy to call from Javascript.
8. Performance is not great. 8. Performance is much better than SOAP-
less CPU intensive, leaner code etc.
Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 6
Introduction- SoapUI
There are 7 important features of SOAPUI
1) Functional Testing
2) Security Testing
3) Load Testing
4) Reports
5) Supported Protocols/Technologies
6) MockService
7) API Testing
SOAPUI SOAPUI is the leading open source cross-platform API Testing tool.
It is an 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..
Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 7
Features- SoapUI
1. Functional Testing Features
Functional Testing features (Open Source version) SOAP UI PRO
WSDL Coverage
Request/Response Coverage
Message Assertion
Test Refactoring
Running of Multiple Tests
Data Source Driven Tests
Scripting Libraries
Unit Reporting
Manual Test Step
Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 8
Features- SoapUI
2. Security Testing Features
Security Testing features (Open Source version) SOAP UI PRO
Boundary Scan
Invalid Type
SQL Injection
XPath Injection
XML Bomb
Fuzzing Scan
Cross Site Scripting
Configurable Scans
Reporting
Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 9
Features- SoapUI
3. Load Testing Features
Load Testing features (Open Source version) SOAP UI PRO
Rapid Load Tests from
Functional Tests
Configurable Load Strategies
Load Test Assertions
Real-Time Statistics
Performance Monitoring
Statistics Exporting
Setup/TearDown using Groovy
Scripting
loadUI Integration
Reporting
Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 10
Features- SoapUI
4. Reports
Reports (Open Source version) SOAP UI PRO
JUnit Reports
Report Data Export
WSDL HTML Report
WSDL Coverage
TestSuite Coverage
TestCase Coverage
Assertion Coverage
Message Recording Coverage
JUnit Reports
Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 11
Features- SoapUI
5) Supported Protocols/Technologies: SoapUI has the most comprehensive Protocol
Support
Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 12
Download, Installation and Configuration - SoapUI
SoapUI is a cross-platform tool. It supports Windows, Linux, and Mac operating systems.
Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 13
Download - SoapUI
Step 1 − Go to www.soapui.org and click Download SoapUI.
Download Process
Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 14
Download - SoapUI
Step 2 − Click ‘Get It’ to download SoapUI Open Source. It will start downloading 112MB
.exe file in the system. Wait till the download process is complete.
Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 15
Installation - SoapUI
Installation Process Step 1 − After downloading, run the .exe file as “Run as administrator”.
Windows will start the set up process as shown in the following screenshot.
Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 16
Installation - SoapUI
.
Step 2 − Once set up, the process window displays the following screen, click
Next.
Step 3 − Accept the license agreement and click Next.
Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 17
Installation - SoapUI
.Step 4 − Choose the installation directory or keep it as the default path
selected by the system. Click Next.
Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 18
Installation - SoapUI
.Step 5 − Choose the components that you want to install. Click Next.
Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 19
Installation - SoapUI
.Step 6 − Accept the License Agreement for HermesJMS and click Next.
Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 20
Installation - SoapUI
.Step 7 − Select the target directory to save tutorials and click Next.
Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 21
Installation - SoapUI
.Step 8 − Choose the start menu folder location or else leave the default location as is and
click 'Next'.
Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 22
Installation - SoapUI
.Step 9 − Enable the checkbox 'create a desktop icon' and click 'Next'.
Now, the installation starts. It will take a few minutes to complete.
Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 23
Installation - SoapUI
.Step 10 − After completion of installation, click Finish in the following wizard.
Upon clicking on Finish, SoapUI is launched.
Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 24
Launched - SoapUI
.
1. Menu bar
2. Tool bar
3. Project Navigation Bar
4. Workspace Properties
5. Log Panel
Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 25
Configuration - SoapUI
.
1. The first step is to create a workspace that can contain multiple projects. For Each
project, we can create several test suites.
2. For Each Test Suite, there can be several test cases attached to it.
3. For Each Test Case, there can be several test steps associated with it.
Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 26
Configuration - SoapUI
.
1. The first step is to create a workspace that can contain multiple projects. For Each
project, we can create several test suites.
2. For Each Test Suite, there can be several test cases attached to it.
3. For Each Test Case, there can be several test steps associated with it.
Step 1 − Go to File → New Workspace.
Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 27
Configuration - SoapUI
.
Step 2 − Add the name of workspace and click OK.
Step 3 − Now, select the path where workspace xml will be saved.
Step 4 − Select the path and click Save.
Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 28
Configuration- SoapUI
Workspace is created as shown in the following screenshot. Workspace
properties is also exhibited.
Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 29
File Menu - SoapUI
Understanding the most frequently used navigations within SOAP-UI is very
important for seamless navigation while working on real-time projects. Let us
take a look at the file menu first.
1.'New SOAP Project' allows user to create a Project by
importing SOAP Request.
2.'New REST Project' allows user to create a Project by
importing REST Request.
3.'Import Project' allows user to import the entire project by
locating the corresponding XML.
4.'Save All Projects' allows user to save all the opened
projects in a single click.
5.'Close All Open Projects' closes all the projects opened in
that workspace.
6.'Rename Workspace' allows user to rename the previously
created workspace.
7.'Switch Workspace' allows user to switch between
workspaces.
8.'Preferences' allows user to customize SOAP UI. We will
deal with it in next section.
9.'Save Preferences' allows user to save their customized
settings. When SOAP UI opened for the next time, it uses
the user saved preferences.
Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 30
FILE >> PREFERENCES >> HTTP SETTINGS - SoapUI
Now, let us understand the 'Preferences' from the file menu. Upon Clicking 'Preferences' from
'File' Menu, the below dialog opens.
We will go through the most frequently used 'HTTP Settings' in details.
1.Denotes the HTTP Version to be used for
request and response.
2.'User-Agent Header' allows user to can be
predefined using this option. If not defined, it
uses the default http client header.
3.Allows user to specify the compression
method. It can be either gzip or deflate or
None.
4.'If Checked', allows compressed response
from hosts.
5.'If Checked' disables decompression of the
compressed responses.
6.'If Checked' closes HTTP connection for
each SOAP Request.
7.'If Checked', allows user to specify
authentication information for the outgoing
requests.
8.Allows user to restrict the maximum number
of bytes to be read from a response. ZERO
corresponds to unlimited size.
Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 31
FILE >> PREFERENCES >> WSDL SETTINGS - SoapUI
Now, we will go through the most frequently used 'WSDL Settings' in details.
1.Cache WSDLs Turns on and off caching of
WSDL's
2.Generates example values in requests
3.Allows users to always include optional
elements in generated requests
4.Response messages are printed in the
response editor
5.Allows user to specify a directory containing
schema (.xsd) files while validating WSDL
requests. Upon changing the contents of this
directory SOAP UI requires a restart.
6.For the purpose of preserving space, the
minimum message size to be compressed in the
SoapUI project file.
Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 32
FILE >> PREFERENCES >> UI SETTINGS - SoapUI
Now, we will go through the most frequently used 'UI Settings' in details.
1.Closes all projects while launching
SOAP UI for better startup-time and
consumes less memory.
2.Displays description whenever
available.
3.Automatically saves all projects while
exiting SOAP UI.
4.Before saving, SOAP UI creates a
backup of the project. If enabled, back
up folder has to be mentioned.
5.Displays and expands the log tabs
upon starting SOAP UI.
6.Displays the 'start up page' dialog
upon starting SOAP UI.
7.Upon disabling tool tip, disables tool
tip when user hovers mouse over the
options/buttons while navigation.
Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 33
HELP - SoapUI
HELP: Let us take a look at the important Help menu options.
Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 34
Create Project, Test Suit, Test Cases- SoapUI
Create a Project
Step 1: Now depending upon the project, we need to import SOAP/REST protocol. We
will create a new SOAP Project.
Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 35
Create a project- SoapUI
Step 2: We will make use following SOAP request
1. Enter the Project Name
2. Enter the path of the WSDL request. In this
case http://www.webservicex.net/CurrencyConvertor.asmx?WSDL
3. Click OK
Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 36
Create a project- SoapUI
Step 3: Upon creating the SOAP project with the above-said WSDL, we will be able to see
that there are two operations that will be imported into the project.
Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 37
Create a project- SoapUI
Step 4) Expand the first request and double click on the 'Request1'. It will display the
SOAP request in the XML format.
Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 38
Create a project- - SoapUI
1. Enter the From Currency and To Currency
2. Click on the submit button. Response XML will be displayed right side pane.
Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 39
Creating a test suit- - SoapUI
Step 1: Within the project, testers can create a test suite by performing a right click on
the root of the project.
Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 40
Creating a test suit- SoapUI
Step 2: We need to enter the name of the test suite and press OK.
Step 3: The created test suite is displayed the navigator pane as shown below.
Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 41
Creating a test suit- SoapUI
Step 4: The test Suite window opens in the Right Pane. As we have just created there
are NO test cases. Hence all options are disabled.
Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 42
Creating Test Case- SoapUI
Creating Test Case
Step 1: Within a test suite, we can create multiple test cases by performing right click on
the 'test suite' and choosing 'New Test Case'.
Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 43
Creating Test Case- SoapUI
Step 2: Specify the name of the Test Case and click 'OK'.
Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 44
Creating test case- SoapUI
Step 3: The created test case has zero steps as shown below. (We can see that the test
case is added with zero test steps for all kinds of tests available. Upon adding the test
steps the numbers in the bracket would change automatically. )
The functional test step should go into 'Test Steps' while a performance test step should go
into 'Load Test' and a security test step should go into 'security Tests'.
Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 45
Creating test step- SoapUI
Step 4: We can insert a variety of test steps by performing a right click on test steps and
selecting an appropriate test step as shown below.
So if you were to test a REST WebService, you would select the REST Test Request.
Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 46
Creating test step- SoapUI
Test Step Insert
Now let us add a test step to validate the imported SOAP request.
Step 1: Add a new step 'SOAP Test Request' as shown below.
Step 2: Enter the step name and click OK.
Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 47
Creating test step - SoapUI
Step 3: Upon clicking 'OK', a dialog pops up to select the operation to invoke.
There are two operations that will be listed. Both the Operations are the same except the
SOAP version used.
CurrencyConvertorSoap – uses SOAP version 1.1 where as,
CurrencyConvertorSoap12 – uses SOAP version 1.2
The Version does not matter for us in this context. Hence you can select the one of your
choice.
Upon Selecting the operation, click 'Ok'
Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 48
Creating test step- SoapUI
Step 4: While adding a test case, we can add standard assertions.
We can add following checkpoints/assertions while creating test case. Let us create a test
case with the default option which means creating test step WITHOUT any of the below
validation points
1. Verifies if the response message is SOAP, upon executing the test.
2. Verifies if the response schema is valid.
3. Verifies if the SOAP response contains FAULT.
Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 49
Creating test step- SoapUI
Step 5: Upon creating the test case, the request XML is shown below.
Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 50
Request and Response - SoapUI
Step 6: The test step count is now incremented to one as we have just added one test
step. Similarly upon adding load and security tests step, the corresponding number would
be automatically incremented based on the number of steps added.
Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 51
Request and Response - SoapUI
Send Request Manually & Reading Response
Step 1: We would like to convert the currency from USD to INR.
FromCurrency – USD
ToCurrency – INR
Next, We need to enter these inputs in place of the question mark which will be sent as
request XML.
After inputting those values into the corresponding XML tags, click 'submit request' button
to check the response.
Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 52
Request and Response - SoapUI
Step 2: After submitting a request the web service request is processed by the
webserver and sends back a response as shown below.
By reading the response, we are able to conclude that 1 unit of USD = (-1) units of INR.
Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 53
Soap Response & Log Panels- SoapUI
Understanding the Soap Response & Log Panels
SOAP messages are transported via HTTP protocol. Let us take a look at the RAW
messages.
Step 1: Click 'RAW' Tab in both SOAP-UI request Window.
The Request is posted to the webserver. Hence, the POST method of Http is used.
The SOAP Request is transported in the body of the Http message as shown below
Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 54
Soap Response & Log Panels- SoapUI
Step 2: Now click 'RAW' Tab in SOAP-UI Response Window to understand how the
response is sent via HTTP.
After processing the request, the Http response code (200) is shown which means it is a
success. The webserver has processed it successfully.
The SOAP response is sent back to the client as part of the body of the HTTP message.
Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 55
HTTP Status Response Codes - SoapUI
Http Code Description
100 – Continue
101 - Switching Protocols
Informational - This means a request received and continuing
process.
200 -- OK
201 -- Created
202 -- Accepted
203 -- Non-Authoritative Information
204 -- No Content
205 -- Reset Content
206 -- Partial Content
Success - The action was successfully received, understood,
and accepted.
300 -- Multiple Choices
301 -- Moved Permanently
302 -- Found
303 -- See Other
304 -- Not Modified
305 -- Use Proxy
307 -- Temporary Redirect
Redirection - This means further action must be taken in order
to complete the request.
400 -- Bad Request
401 -- Unauthorized
402 -- Payment Required
403 -- Forbidden
404 -- Not Found
Client Error - This means the request contains bad syntax or
cannot be fulfilled
500 -- Internal Server Error
501 -- Not Implemented
502 -- Bad Gateway
503 -- Service Unavailable
504 -- Gateway Timeout - 505 - HTTP Version Not Supported
Server Error - The server failed to fulfill an apparently valid
request
A Quick snapshot of the Http Response codes for easy understanding and debugging.
The below table will help you to trouble shoot based on the HTTP code received from the
webserver.
Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 56
Soap Response & Log Panels- SoapUI
Step 3: Let us understand the other information that are displayed in the test case window.
1.Represent NO header in the request that is being sent
2.Represents NO attachments in the request that is being sent to the web server.
3.Represents 12 header information and the same are displayed upon clicking on it.
4.Represents that there are no attachments from the response message.
Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 57
Log Panels- SoapUI
SoapUI Log: has the complete information regarding the transaction between the client and
the server. Users will be able to see the tabs of the Log pane as shown below.
Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 58
Log Panels- SoapUI
Http log: Displays all the HTTP packet transfer. All the information in 'RAW' is shown in HTTP
log.
Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 59
Log Panels- SoapUI
Error Log – Error log displays all the errors that we have encountered during the entire project
session. The same information is available in 'soapui-errors.log' present in the 'bin' directory of
the SOAP UI installed location.
Memory Log – This tab monitors the memory consumption and displays it in the form of the
chart as shown below. It is really helpful when there is a memory intensive operation is
performed.
Now that we have created test suite, test case, test step and got a response, next step is
to validate the response.
Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 60
Assertions - SoapUI
Assertion means act of affirming or stating something. It can also be interpreted as check point
or a validation point.
Once a request is sent to a web server a response is received. We need to validate if the
response contains the data that we expect. In order to validate the response, we need to use
assertions.
Types Of Assertion
There are various ways of asserting a response; however we will focus on the commonly used
Assertions types while validating a response. Below are the ones that are available in Open
Source version of SoapUI.
1. Contains Assertion
2. Not contains Assertion
3. X Path Match Assertion.
4. X Query Match Assertion
5. Scripting Assertion
Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 61
More learning - SoapUI
The more we practice, the more we learn.
The next session will learn-
1. Functional Testing
2. Load Testing
3. API testing
4. Security Testing.
5. Mock Service
6. Reports
Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 62
Q & A- - SoapUI
Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 63
SoapUI

Weitere ähnliche Inhalte

Was ist angesagt?

Was ist angesagt? (20)

Introduction to Swagger
Introduction to SwaggerIntroduction to Swagger
Introduction to Swagger
 
Belajar Postman test runner
Belajar Postman test runnerBelajar Postman test runner
Belajar Postman test runner
 
Soa testing soap ui (2)
Soa testing   soap ui (2)Soa testing   soap ui (2)
Soa testing soap ui (2)
 
Postman
PostmanPostman
Postman
 
API Test Automation
API Test Automation API Test Automation
API Test Automation
 
Soap ui
Soap uiSoap ui
Soap ui
 
Postman.ppt
Postman.pptPostman.ppt
Postman.ppt
 
Api Testing
Api TestingApi Testing
Api Testing
 
API_Testing_with_Postman
API_Testing_with_PostmanAPI_Testing_with_Postman
API_Testing_with_Postman
 
Soap UI and postman
Soap UI and postmanSoap UI and postman
Soap UI and postman
 
Browser_Stack_Intro
Browser_Stack_IntroBrowser_Stack_Intro
Browser_Stack_Intro
 
Mock Server Using WireMock
Mock Server Using WireMockMock Server Using WireMock
Mock Server Using WireMock
 
Web API testing : A quick glance
Web API testing : A quick glanceWeb API testing : A quick glance
Web API testing : A quick glance
 
An introduction to api testing | David Tzemach
An introduction to api testing | David TzemachAn introduction to api testing | David Tzemach
An introduction to api testing | David Tzemach
 
Postman Introduction
Postman IntroductionPostman Introduction
Postman Introduction
 
API Docs with OpenAPI 3.0
API Docs with OpenAPI 3.0API Docs with OpenAPI 3.0
API Docs with OpenAPI 3.0
 
Rest assured
Rest assuredRest assured
Rest assured
 
Web Services Automated Testing via SoapUI Tool
Web Services Automated Testing via SoapUI ToolWeb Services Automated Testing via SoapUI Tool
Web Services Automated Testing via SoapUI Tool
 
4 Major Advantages of API Testing
4 Major Advantages of API Testing4 Major Advantages of API Testing
4 Major Advantages of API Testing
 
Accelerate Quality with Postman - Basics
Accelerate Quality with Postman - BasicsAccelerate Quality with Postman - Basics
Accelerate Quality with Postman - Basics
 

Ähnlich wie Testing soap UI

Ähnlich wie Testing soap UI (20)

Proper Connections Development for Proper Domino Developers
Proper Connections Development for Proper Domino DevelopersProper Connections Development for Proper Domino Developers
Proper Connections Development for Proper Domino Developers
 
Appium solution
Appium solutionAppium solution
Appium solution
 
Django simplified : by weever mbakaya
Django simplified : by weever mbakayaDjango simplified : by weever mbakaya
Django simplified : by weever mbakaya
 
P H P Framework
P H P  FrameworkP H P  Framework
P H P Framework
 
Introduction to soapui and webservices
Introduction to soapui  and webservicesIntroduction to soapui  and webservices
Introduction to soapui and webservices
 
Soap ui documentation
Soap ui documentationSoap ui documentation
Soap ui documentation
 
Public-i User Group Presentation (June 14)
Public-i User Group Presentation (June 14)Public-i User Group Presentation (June 14)
Public-i User Group Presentation (June 14)
 
Lab view web vis
Lab view web visLab view web vis
Lab view web vis
 
JCON_15FactorWorkshop.pptx
JCON_15FactorWorkshop.pptxJCON_15FactorWorkshop.pptx
JCON_15FactorWorkshop.pptx
 
PWA basics for developers
PWA basics for developersPWA basics for developers
PWA basics for developers
 
LoadUI web performance testing tool
LoadUI web performance testing toolLoadUI web performance testing tool
LoadUI web performance testing tool
 
Load ui web Load Testing Open source Performance Testing tool Learn Load UI W...
Load ui web Load Testing Open source Performance Testing tool Learn Load UI W...Load ui web Load Testing Open source Performance Testing tool Learn Load UI W...
Load ui web Load Testing Open source Performance Testing tool Learn Load UI W...
 
Soap ui p_squickit
Soap ui p_squickitSoap ui p_squickit
Soap ui p_squickit
 
Web application penetration testing lab setup guide
Web application penetration testing lab setup guideWeb application penetration testing lab setup guide
Web application penetration testing lab setup guide
 
Appium.pptx
Appium.pptxAppium.pptx
Appium.pptx
 
White paper ready api
White paper  ready apiWhite paper  ready api
White paper ready api
 
How to Create "Hello, World!" in Fiori
How to Create "Hello, World!" in FioriHow to Create "Hello, World!" in Fiori
How to Create "Hello, World!" in Fiori
 
Learn Selenium - Online Guide
Learn Selenium - Online GuideLearn Selenium - Online Guide
Learn Selenium - Online Guide
 
OpenControl Overview - Joshua McKenty
OpenControl Overview - Joshua McKentyOpenControl Overview - Joshua McKenty
OpenControl Overview - Joshua McKenty
 
MuleSoft Surat Virtual Meetup#4 - Anypoint Monitoring and MuleSoft dataloader.io
MuleSoft Surat Virtual Meetup#4 - Anypoint Monitoring and MuleSoft dataloader.ioMuleSoft Surat Virtual Meetup#4 - Anypoint Monitoring and MuleSoft dataloader.io
MuleSoft Surat Virtual Meetup#4 - Anypoint Monitoring and MuleSoft dataloader.io
 

Kürzlich hochgeladen

CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
masabamasaba
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
shinachiaurasa2
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
masabamasaba
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
masabamasaba
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
VictoriaMetrics
 

Kürzlich hochgeladen (20)

Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
tonesoftg
tonesoftgtonesoftg
tonesoftg
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
Harnessing ChatGPT - Elevating Productivity in Today's Agile Environment
Harnessing ChatGPT  - Elevating Productivity in Today's Agile EnvironmentHarnessing ChatGPT  - Elevating Productivity in Today's Agile Environment
Harnessing ChatGPT - Elevating Productivity in Today's Agile Environment
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
 

Testing soap UI

  • 1. Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL API Testing in SoapUI By Razia Sultana 25-01-2018 Knowledge Sharing Session
  • 2. Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 2 Agenda 1. API 2. RESTful API 3. Difference between SOAP and REST 4. SoapUI: Introduction and Features 5. SoapUI: Download, Installation, Configuration 6. SoapUI: Create a SOAP Project, Test Suite, Test Case 7. SoapUI: Assertions 8. Functional Testing 9. Load Testing 10.Security Testing 11.API testing 12.MockService 13.Reports
  • 3. Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 3 API Testing (API) Application Program Interface that is sharing data from a program with another program. For example: Like bell mark / canon, company made a printer for printing but they did not make Microsoft word. How does Microsoft word print on that printer? There is definitely a relationship between Microsoft and Canon. Actually there is no relation between application software or printer/Canon. Two programs communicate using an interface or medium. This medium is called API. When have a print command in Microsoft Word, he requests the printer status to the API, and if all is correct, then print the document to the API. The API asks the printer to print the document. The printer needs to know exactly what a program is asking to print, when a document arrives near the printer, the printer will read it and print it.
  • 4. Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 4 RESTful API Testing (RESTful API) When Web services use REST (REpresentational state transfer) architecture, they are called RESTful API that uses HTTP requests to GET, PUT, POST and DELETE data. HTTP Methods GET: The GET method is used to retrieve data from a server at the specified resource. POST: requests are used to send data to the API sever to create or update a resource. PUT: requests are used to send data to the API to create or update a resource. DELETE: method is exactly as it sounds: delete the resource at the specified URL. The REST style emphasizes the interactions between clients and services. REST is an alternative to SOAP (Simple Object Access Protocol) and instead of using XML for request REST uses simple URL in some cases. Rest API supports both XML and JSON format.
  • 5. Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 5 SOAP and REST - Compared SOAP REST 1. Simple Object Access Protocol. 1. Representational State Transfer. 2. A XML based message protocol. 2. An architectural style protocol. 3. Uses WSDL for communication between consumer and provider. 3. Uses XML & JSON to send and receive data. 4. Invokes service by calling RPC method. 4. Simply calls via URL path. 5. Does not return human readable result. 5. Result is readable which is just plain XML or JSON. 6. Transfer is over HTTP, SMTP or FTP protocol. 6. Transfer is over HTTP only. 7. Javascript can call SOAP but it is difficult to implement. 7. Easy to call from Javascript. 8. Performance is not great. 8. Performance is much better than SOAP- less CPU intensive, leaner code etc.
  • 6. Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 6 Introduction- SoapUI There are 7 important features of SOAPUI 1) Functional Testing 2) Security Testing 3) Load Testing 4) Reports 5) Supported Protocols/Technologies 6) MockService 7) API Testing SOAPUI SOAPUI is the leading open source cross-platform API Testing tool. It is an 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..
  • 7. Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 7 Features- SoapUI 1. Functional Testing Features Functional Testing features (Open Source version) SOAP UI PRO WSDL Coverage Request/Response Coverage Message Assertion Test Refactoring Running of Multiple Tests Data Source Driven Tests Scripting Libraries Unit Reporting Manual Test Step
  • 8. Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 8 Features- SoapUI 2. Security Testing Features Security Testing features (Open Source version) SOAP UI PRO Boundary Scan Invalid Type SQL Injection XPath Injection XML Bomb Fuzzing Scan Cross Site Scripting Configurable Scans Reporting
  • 9. Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 9 Features- SoapUI 3. Load Testing Features Load Testing features (Open Source version) SOAP UI PRO Rapid Load Tests from Functional Tests Configurable Load Strategies Load Test Assertions Real-Time Statistics Performance Monitoring Statistics Exporting Setup/TearDown using Groovy Scripting loadUI Integration Reporting
  • 10. Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 10 Features- SoapUI 4. Reports Reports (Open Source version) SOAP UI PRO JUnit Reports Report Data Export WSDL HTML Report WSDL Coverage TestSuite Coverage TestCase Coverage Assertion Coverage Message Recording Coverage JUnit Reports
  • 11. Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 11 Features- SoapUI 5) Supported Protocols/Technologies: SoapUI has the most comprehensive Protocol Support
  • 12. Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 12 Download, Installation and Configuration - SoapUI SoapUI is a cross-platform tool. It supports Windows, Linux, and Mac operating systems.
  • 13. Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 13 Download - SoapUI Step 1 − Go to www.soapui.org and click Download SoapUI. Download Process
  • 14. Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 14 Download - SoapUI Step 2 − Click ‘Get It’ to download SoapUI Open Source. It will start downloading 112MB .exe file in the system. Wait till the download process is complete.
  • 15. Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 15 Installation - SoapUI Installation Process Step 1 − After downloading, run the .exe file as “Run as administrator”. Windows will start the set up process as shown in the following screenshot.
  • 16. Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 16 Installation - SoapUI . Step 2 − Once set up, the process window displays the following screen, click Next. Step 3 − Accept the license agreement and click Next.
  • 17. Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 17 Installation - SoapUI .Step 4 − Choose the installation directory or keep it as the default path selected by the system. Click Next.
  • 18. Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 18 Installation - SoapUI .Step 5 − Choose the components that you want to install. Click Next.
  • 19. Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 19 Installation - SoapUI .Step 6 − Accept the License Agreement for HermesJMS and click Next.
  • 20. Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 20 Installation - SoapUI .Step 7 − Select the target directory to save tutorials and click Next.
  • 21. Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 21 Installation - SoapUI .Step 8 − Choose the start menu folder location or else leave the default location as is and click 'Next'.
  • 22. Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 22 Installation - SoapUI .Step 9 − Enable the checkbox 'create a desktop icon' and click 'Next'. Now, the installation starts. It will take a few minutes to complete.
  • 23. Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 23 Installation - SoapUI .Step 10 − After completion of installation, click Finish in the following wizard. Upon clicking on Finish, SoapUI is launched.
  • 24. Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 24 Launched - SoapUI . 1. Menu bar 2. Tool bar 3. Project Navigation Bar 4. Workspace Properties 5. Log Panel
  • 25. Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 25 Configuration - SoapUI . 1. The first step is to create a workspace that can contain multiple projects. For Each project, we can create several test suites. 2. For Each Test Suite, there can be several test cases attached to it. 3. For Each Test Case, there can be several test steps associated with it.
  • 26. Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 26 Configuration - SoapUI . 1. The first step is to create a workspace that can contain multiple projects. For Each project, we can create several test suites. 2. For Each Test Suite, there can be several test cases attached to it. 3. For Each Test Case, there can be several test steps associated with it. Step 1 − Go to File → New Workspace.
  • 27. Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 27 Configuration - SoapUI . Step 2 − Add the name of workspace and click OK. Step 3 − Now, select the path where workspace xml will be saved. Step 4 − Select the path and click Save.
  • 28. Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 28 Configuration- SoapUI Workspace is created as shown in the following screenshot. Workspace properties is also exhibited.
  • 29. Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 29 File Menu - SoapUI Understanding the most frequently used navigations within SOAP-UI is very important for seamless navigation while working on real-time projects. Let us take a look at the file menu first. 1.'New SOAP Project' allows user to create a Project by importing SOAP Request. 2.'New REST Project' allows user to create a Project by importing REST Request. 3.'Import Project' allows user to import the entire project by locating the corresponding XML. 4.'Save All Projects' allows user to save all the opened projects in a single click. 5.'Close All Open Projects' closes all the projects opened in that workspace. 6.'Rename Workspace' allows user to rename the previously created workspace. 7.'Switch Workspace' allows user to switch between workspaces. 8.'Preferences' allows user to customize SOAP UI. We will deal with it in next section. 9.'Save Preferences' allows user to save their customized settings. When SOAP UI opened for the next time, it uses the user saved preferences.
  • 30. Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 30 FILE >> PREFERENCES >> HTTP SETTINGS - SoapUI Now, let us understand the 'Preferences' from the file menu. Upon Clicking 'Preferences' from 'File' Menu, the below dialog opens. We will go through the most frequently used 'HTTP Settings' in details. 1.Denotes the HTTP Version to be used for request and response. 2.'User-Agent Header' allows user to can be predefined using this option. If not defined, it uses the default http client header. 3.Allows user to specify the compression method. It can be either gzip or deflate or None. 4.'If Checked', allows compressed response from hosts. 5.'If Checked' disables decompression of the compressed responses. 6.'If Checked' closes HTTP connection for each SOAP Request. 7.'If Checked', allows user to specify authentication information for the outgoing requests. 8.Allows user to restrict the maximum number of bytes to be read from a response. ZERO corresponds to unlimited size.
  • 31. Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 31 FILE >> PREFERENCES >> WSDL SETTINGS - SoapUI Now, we will go through the most frequently used 'WSDL Settings' in details. 1.Cache WSDLs Turns on and off caching of WSDL's 2.Generates example values in requests 3.Allows users to always include optional elements in generated requests 4.Response messages are printed in the response editor 5.Allows user to specify a directory containing schema (.xsd) files while validating WSDL requests. Upon changing the contents of this directory SOAP UI requires a restart. 6.For the purpose of preserving space, the minimum message size to be compressed in the SoapUI project file.
  • 32. Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 32 FILE >> PREFERENCES >> UI SETTINGS - SoapUI Now, we will go through the most frequently used 'UI Settings' in details. 1.Closes all projects while launching SOAP UI for better startup-time and consumes less memory. 2.Displays description whenever available. 3.Automatically saves all projects while exiting SOAP UI. 4.Before saving, SOAP UI creates a backup of the project. If enabled, back up folder has to be mentioned. 5.Displays and expands the log tabs upon starting SOAP UI. 6.Displays the 'start up page' dialog upon starting SOAP UI. 7.Upon disabling tool tip, disables tool tip when user hovers mouse over the options/buttons while navigation.
  • 33. Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 33 HELP - SoapUI HELP: Let us take a look at the important Help menu options.
  • 34. Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 34 Create Project, Test Suit, Test Cases- SoapUI Create a Project Step 1: Now depending upon the project, we need to import SOAP/REST protocol. We will create a new SOAP Project.
  • 35. Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 35 Create a project- SoapUI Step 2: We will make use following SOAP request 1. Enter the Project Name 2. Enter the path of the WSDL request. In this case http://www.webservicex.net/CurrencyConvertor.asmx?WSDL 3. Click OK
  • 36. Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 36 Create a project- SoapUI Step 3: Upon creating the SOAP project with the above-said WSDL, we will be able to see that there are two operations that will be imported into the project.
  • 37. Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 37 Create a project- SoapUI Step 4) Expand the first request and double click on the 'Request1'. It will display the SOAP request in the XML format.
  • 38. Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 38 Create a project- - SoapUI 1. Enter the From Currency and To Currency 2. Click on the submit button. Response XML will be displayed right side pane.
  • 39. Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 39 Creating a test suit- - SoapUI Step 1: Within the project, testers can create a test suite by performing a right click on the root of the project.
  • 40. Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 40 Creating a test suit- SoapUI Step 2: We need to enter the name of the test suite and press OK. Step 3: The created test suite is displayed the navigator pane as shown below.
  • 41. Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 41 Creating a test suit- SoapUI Step 4: The test Suite window opens in the Right Pane. As we have just created there are NO test cases. Hence all options are disabled.
  • 42. Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 42 Creating Test Case- SoapUI Creating Test Case Step 1: Within a test suite, we can create multiple test cases by performing right click on the 'test suite' and choosing 'New Test Case'.
  • 43. Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 43 Creating Test Case- SoapUI Step 2: Specify the name of the Test Case and click 'OK'.
  • 44. Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 44 Creating test case- SoapUI Step 3: The created test case has zero steps as shown below. (We can see that the test case is added with zero test steps for all kinds of tests available. Upon adding the test steps the numbers in the bracket would change automatically. ) The functional test step should go into 'Test Steps' while a performance test step should go into 'Load Test' and a security test step should go into 'security Tests'.
  • 45. Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 45 Creating test step- SoapUI Step 4: We can insert a variety of test steps by performing a right click on test steps and selecting an appropriate test step as shown below. So if you were to test a REST WebService, you would select the REST Test Request.
  • 46. Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 46 Creating test step- SoapUI Test Step Insert Now let us add a test step to validate the imported SOAP request. Step 1: Add a new step 'SOAP Test Request' as shown below. Step 2: Enter the step name and click OK.
  • 47. Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 47 Creating test step - SoapUI Step 3: Upon clicking 'OK', a dialog pops up to select the operation to invoke. There are two operations that will be listed. Both the Operations are the same except the SOAP version used. CurrencyConvertorSoap – uses SOAP version 1.1 where as, CurrencyConvertorSoap12 – uses SOAP version 1.2 The Version does not matter for us in this context. Hence you can select the one of your choice. Upon Selecting the operation, click 'Ok'
  • 48. Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 48 Creating test step- SoapUI Step 4: While adding a test case, we can add standard assertions. We can add following checkpoints/assertions while creating test case. Let us create a test case with the default option which means creating test step WITHOUT any of the below validation points 1. Verifies if the response message is SOAP, upon executing the test. 2. Verifies if the response schema is valid. 3. Verifies if the SOAP response contains FAULT.
  • 49. Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 49 Creating test step- SoapUI Step 5: Upon creating the test case, the request XML is shown below.
  • 50. Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 50 Request and Response - SoapUI Step 6: The test step count is now incremented to one as we have just added one test step. Similarly upon adding load and security tests step, the corresponding number would be automatically incremented based on the number of steps added.
  • 51. Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 51 Request and Response - SoapUI Send Request Manually & Reading Response Step 1: We would like to convert the currency from USD to INR. FromCurrency – USD ToCurrency – INR Next, We need to enter these inputs in place of the question mark which will be sent as request XML. After inputting those values into the corresponding XML tags, click 'submit request' button to check the response.
  • 52. Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 52 Request and Response - SoapUI Step 2: After submitting a request the web service request is processed by the webserver and sends back a response as shown below. By reading the response, we are able to conclude that 1 unit of USD = (-1) units of INR.
  • 53. Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 53 Soap Response & Log Panels- SoapUI Understanding the Soap Response & Log Panels SOAP messages are transported via HTTP protocol. Let us take a look at the RAW messages. Step 1: Click 'RAW' Tab in both SOAP-UI request Window. The Request is posted to the webserver. Hence, the POST method of Http is used. The SOAP Request is transported in the body of the Http message as shown below
  • 54. Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 54 Soap Response & Log Panels- SoapUI Step 2: Now click 'RAW' Tab in SOAP-UI Response Window to understand how the response is sent via HTTP. After processing the request, the Http response code (200) is shown which means it is a success. The webserver has processed it successfully. The SOAP response is sent back to the client as part of the body of the HTTP message.
  • 55. Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 55 HTTP Status Response Codes - SoapUI Http Code Description 100 – Continue 101 - Switching Protocols Informational - This means a request received and continuing process. 200 -- OK 201 -- Created 202 -- Accepted 203 -- Non-Authoritative Information 204 -- No Content 205 -- Reset Content 206 -- Partial Content Success - The action was successfully received, understood, and accepted. 300 -- Multiple Choices 301 -- Moved Permanently 302 -- Found 303 -- See Other 304 -- Not Modified 305 -- Use Proxy 307 -- Temporary Redirect Redirection - This means further action must be taken in order to complete the request. 400 -- Bad Request 401 -- Unauthorized 402 -- Payment Required 403 -- Forbidden 404 -- Not Found Client Error - This means the request contains bad syntax or cannot be fulfilled 500 -- Internal Server Error 501 -- Not Implemented 502 -- Bad Gateway 503 -- Service Unavailable 504 -- Gateway Timeout - 505 - HTTP Version Not Supported Server Error - The server failed to fulfill an apparently valid request A Quick snapshot of the Http Response codes for easy understanding and debugging. The below table will help you to trouble shoot based on the HTTP code received from the webserver.
  • 56. Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 56 Soap Response & Log Panels- SoapUI Step 3: Let us understand the other information that are displayed in the test case window. 1.Represent NO header in the request that is being sent 2.Represents NO attachments in the request that is being sent to the web server. 3.Represents 12 header information and the same are displayed upon clicking on it. 4.Represents that there are no attachments from the response message.
  • 57. Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 57 Log Panels- SoapUI SoapUI Log: has the complete information regarding the transaction between the client and the server. Users will be able to see the tabs of the Log pane as shown below.
  • 58. Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 58 Log Panels- SoapUI Http log: Displays all the HTTP packet transfer. All the information in 'RAW' is shown in HTTP log.
  • 59. Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 59 Log Panels- SoapUI Error Log – Error log displays all the errors that we have encountered during the entire project session. The same information is available in 'soapui-errors.log' present in the 'bin' directory of the SOAP UI installed location. Memory Log – This tab monitors the memory consumption and displays it in the form of the chart as shown below. It is really helpful when there is a memory intensive operation is performed. Now that we have created test suite, test case, test step and got a response, next step is to validate the response.
  • 60. Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 60 Assertions - SoapUI Assertion means act of affirming or stating something. It can also be interpreted as check point or a validation point. Once a request is sent to a web server a response is received. We need to validate if the response contains the data that we expect. In order to validate the response, we need to use assertions. Types Of Assertion There are various ways of asserting a response; however we will focus on the commonly used Assertions types while validating a response. Below are the ones that are available in Open Source version of SoapUI. 1. Contains Assertion 2. Not contains Assertion 3. X Path Match Assertion. 4. X Query Match Assertion 5. Scripting Assertion
  • 61. Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 61 More learning - SoapUI The more we practice, the more we learn. The next session will learn- 1. Functional Testing 2. Load Testing 3. API testing 4. Security Testing. 5. Mock Service 6. Reports
  • 62. Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 62 Q & A- - SoapUI
  • 63. Copyright @2014, BJIT Group. All Rights ReservedCONFIDENTIAL 63 SoapUI

Hinweis der Redaktion

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  10. 10
  11. 11
  12. 12
  13. 13
  14. 14
  15. 15
  16. 16
  17. 17
  18. 18
  19. 19
  20. 20
  21. 21
  22. 22
  23. 23
  24. 24
  25. 25
  26. 26
  27. 27
  28. 28
  29. 29
  30. 30
  31. 31
  32. 32
  33. 33
  34. 34
  35. 35
  36. 36
  37. 37
  38. 38
  39. 39
  40. 40
  41. 41
  42. 42
  43. 43
  44. 44
  45. 45
  46. 46
  47. 47
  48. 48
  49. 49
  50. 50
  51. 51
  52. 52
  53. 53
  54. 54
  55. 55
  56. 56
  57. 57
  58. 58
  59. 59
  60. 60
  61. 61
  62. 62
  63. 63