Beruflich Dokumente
Kultur Dokumente
Contents
What is SOA?
Traditional MVC vs SOA
Why SOA needed?
What is Web service and its
significance?
What is WSDL?
What is SOAP protocol and
its significance?
Introduction to SOA testing
J anuary25, 2012
What is SOA
Service-Oriented Architecture (SOA) is an architectural style
Applications built using an SOA style deliver functionality as services
(e.g Create Customer, Get Customer Info, Add Account functionalities
in a banking domain) that can be used or reused when building
applications or integrating within the enterprise or trading partners.
A service-oriented architecture is essentially a collection of services
which is based on heterogeneous technologies.
J anuary25, 2012
J anuary25, 2012
Why SOA
The reality in IT enterprises is that infrastructure is heterogeneous
across operating systems, applications, system software, and
application infrastructure.
Enterprises should quickly respond to business changes with agility .
But some existing applications are used to run current business
processes, so starting from scratch to build new infrastructure isn't an
option.
SOA with its loosely coupled nature allows enterprises to plug in new
services or upgrade existing services in a granular fashion to address
the new business requirements, provides the option to make the
services consumable across different channels, and exposes the
existing enterprise and legacy applications as services, thereby
safeguarding existing IT infrastructure investments.
J anuary25, 2012
Benefits Of SOA
Platform and technology independent.
Modularized and less complex.
Low integration cost.
Secure and reliable.
Loosely coupled.
Change is easy.
Re-usable across the business channels.
J anuary25, 2012
Web Service
J anuary25, 2012
WSDL
J anuary25, 2012
J anuary25, 2012
Structure of a WSDL
<definitions>
<types>
data type definitions........
</types>
<message>
definition of the data being communicated....
</message>
<portType>
set of operations......
</portType>
<binding>
protocol and data format specification....
</binding>
</definitions>
J anuary25, 2012
J anuary25, 2012
SOAP
SOAP stands for Simple Object Access Protocol
SOAP is a communication protocol for communication between
service based applications
SOAP is a format for sending messages
SOAP relies on other application layer protocols, like Hypertext
Transfer Protocol (HTTP) or Simple Mail Transfer Protocol (SMTP),
for message negotiation and transmission
SOAP is platform independent
SOAP is language independent
SOAP is based on XML
SOAP is simple and extensible
SOAP allows you to get around firewalls
J anuary25, 2012
Why SOAP
Today's applications communicate using Remote Procedure Calls
(RPC) between different objects.
RPC represents a compatibility and security problem; firewalls and
proxy servers will normally block this kind of traffic.
A better way to communicate between applications is over HTTP,
because HTTP is supported by all Internet browsers and servers.
SOAP was created to accomplish this.
SOAP provides a way to communicate between applications running
on different operating systems, with different technologies and
programming languages.
J anuary25, 2012
SOAP Syntax
A SOAP message is an ordinary XML document containing the following
elements:
An Envelope element that identifies the XML document as a SOAP
message
A Header element that contains header information
A Body element that contains call and response information
A Fault element containing errors and status information
J anuary25, 2012
<soap:Fault>
...
</soap:Fault>
</soap:Body>
</soap:Envelope>
J anuary25, 2012
J anuary25, 2012
J anuary25, 2012
J anuary25, 2012
J anuary25, 2012
J anuary25, 2012
J anuary25, 2012
J anuary25, 2012
J anuary25, 2012
J anuary25, 2012
Creating a Workspace
Workspace is nothing but a physical folder in your local machine to
store and browse projects created with Parasoft SOA test tool.
A single workspace can contain multiple projects and there can be
multiple workspaces for different projects.
For creating a workspace we can either create a folder in our local
machine and browse it through SOA test tool or else we can create
a workspace through tool while opening it initially .
J anuary25, 2012
J anuary25, 2012
J anuary25, 2012
Give a name to the Test file, click Next, select Empty and click
Finish.
J anuary25, 2012
Test Suite.
Test Suite is a collection of tests designed for better maintainability.
Test Suite is used for controlling , how the datasource would be
iterated over tests and how the tests would be executed.
J anuary25, 2012
Environment
It is common for Web service applications to be developed and
maintained by different teams under different environments. For
example, a developer may start with tests on a server deployed on
his or her local machine, then as the server is deployed to a
development build server, the same tests would need to be
executed against that server, then QA and testing teams would
need to run the same regression tests on their own integration
server.
So Parasoft SOAtest includes an Environments management
feature where you can declare variables that changes with the
environment change.
J anuary25, 2012
Adding an Environment
When you add a Test file to your project a Test Suite and an
Environment structure automatically gets created.
J anuary25, 2012
SOAP Client
The SOAP Client tool sends messages to SOAP servers. It can be
used to test a Web service, test the communication between the
client and server, and check the content of the SOAP messages.
You can use the SOAP Client tool to test services with or without a
WSDL. This tool is the foundation of most test cases.
To send a message using the SOAP Client tool, you need to tell
SOAtest what message to send and how to send it. This is done by
specifying the parameters in the Project Configuration panel
J anuary25, 2012
J anuary25, 2012
J anuary25, 2012
J anuary25, 2012
J anuary25, 2012
Creating a Header
Right click on the outer Test
SuiteAddNewGobalPropertyExpand GlobalPropertySOAP
Headers.
J anuary25, 2012
J anuary25, 2012
Parametrize inputs
To automate execution of multiple test cases simultaneously , we
cant test those with fix values in SOAP client. Thats why, Parasoft
SOA test tool provides multiple options to parameterize you inputs
with the help of datasource .
Data sources can be added at multiple levels: TestSuite,Project &
Global. The higher the level of the data source, the more widely it
can be shared. For instance, if you want to add a data source that is
applicable only to a specific test suite, add it at the test suite level. If
you want to share it across test suites in a project, add it at the
project level. If you want to share it across multiple projects, add it at
the global level.
You can specify any number of data sources for a test suite, and
you can use any specified data source throughout a test suites
tests.
J anuary25, 2012
Adding a Datasource.
Right click on the Test Suite for which you want to add the
datasource. Select AddNewDataSourceSelect the type of
DataSource you want to addFinish.
J anuary25, 2012
Adding a Datasource
Generally we use excel as the datasource for easy upgradation and
reusability of the same excel for multiple datasources.
Once you select an excel file as your datasource, browse the excel
from your local and select the appropriate sheet. Now click on the
ShowColumns button to view the columns.
J anuary25, 2012
Parametrize inputs
Once the datasource has been added, select the datasource in your
SOAP client.
J anuary25, 2012
Assertor
The XML Assertor is used to enforce the correctness of data in an
XML message. It is most commonly connected to a SOAP Client in
order to verify the data returned by a service.
The XML Assertor consists of three main tabs:
Summary: This tab contains a table showing the details of the XML
Assertions that have been configured.
Configuration: This tab is used to create and configure XML
Assertions.
Expected XML: Specifies the expected XML response.
J anuary25, 2012
Adding an Assertor
Right click on the SOAP clientAdd OutputSelect SOAP
Envelope under ResponseXML AssertorFinish
J anuary25, 2012
Adding an Assertor
Once the Assertor has been added, go to the Configuration
tabClick on Add..Select type of Assertor you want to use.
J anuary25, 2012
Types of Assertor
Value Assertions: The following value assertions are available:
Value Assertion: Enforce the value of a particular element.
Value Occurrence Assertion: Enforce the occurrence of a value for
an element.
Numeric Assertion: Enforce the numeric value of an element.
String Comparison Assertion: Enforce the value of the text content
of a given element.
Regular Expression Assertion: Enforce that an element matches a
regular expression.
Expression Assertion: Enforce the value of an expression
composed of elements.
Custom Assertion: Enforce custom assertion on an element.
J anuary25, 2012
Types of Assertor
Structure Assertions: The following structure assertions are
available:
Occurrence Assertion: Enforce the number of occurrences of an
element.
Has Content Assertion: Enforce that an element has text
content.
Compound Assertions: The following compound assertions are
available:
AND Assertion: Group multiple assertions that all must succeed.
OR Assertion: Group multiple assertions where at least one must
succeed.
Conditional Assertion: Enforce an assertion only if a condition is
met.
J anuary25, 2012
Types of Assertor
Difference Assertions: The following difference assertions are
available:
Numeric Difference Assertion: Enforce a numeric difference on
a value of a particular element. Assert that the numeric value of an
element differs from a user-specified base value by a user-specified
value.
J anuary25, 2012
Types of Assertor
Range Assertions: The following difference assertions are
available:
Numeric Range Assertion: Enforce a numeric range on a value
of a particular element.
Date Range Assertion: Enforce a date range on a value of a
particular element.
DateTime Range Assertion: Enforce a date time range on a
value of a particular element
J anuary25, 2012
Then in the expected value field give the expected value for the
selected node.
J anuary25, 2012
J anuary25, 2012
J anuary25, 2012
J anuary25, 2012
XML Transformer
The XML Transformer gives you XSLT-like functionality to transform
any XML. This is very useful if you would like to create a regression
control using only a few elements of the SOAP response or request.
Any time you would like to pass a particular subset of an XML
response to a chained tool, the XML Transformer is the tool for the
job.
We can chain all most all types of tools to XML Transformer. The
input to the tool chained to the transformer is taken from the node
trapped by the transformer.
J anuary25, 2012
J anuary25, 2012
J anuary25, 2012
Write file
To provide the proof of our test execution, we need a method by
which we can store the request/response in a local file. Hence
Parasoft SOA test tool has the write file tool.
The Write File tool converts output data to files and is typically
added as an output to an existing tool. The file can be named with a
number of wildcards that include date, time, test name, and a unique
ID.
J anuary25, 2012
J anuary25, 2012
J anuary25, 2012
Extension Tool
It is he primary tool for interfacing with the Extensibility API. It allows
for extending tests with actions that may not be directly supported
by built-in features. Supports Java, JavaScript and Python/Jython
for writing custom scripts that address unique system needs. This
tool permits users to perform complex validation or transformation
operations on tool outputs, or execute any custom actions as part of
test scenarios. For examples, check out http://forums.parasoft.com
and navigate to the SOAtest Scripting Examples forum. You can
also refer to the Extensibility API, found under the Help menu.
J anuary25, 2012
Jython Scripts
J anuary25, 2012
About Jython
Jython is an implementation of Python scripting language
for the JVM.
Jython takes the Python programming language syntax
and enables it to run on the Java platform.
This allows seamless integration with the use of Java
libraries and other Java-based applications.
J anuary25, 2012
J anuary25, 2012
Declaring variable:a=5
b=7
name=manas
x=[7,1,9]
J anuary25, 2012
J anuary25, 2012
Thank You
J anuary25, 2012