Sunteți pe pagina 1din 10

Table of Content

Days Required Topic


Day 1 Overview of webservices Practice
SOAP REST Practice
Day 2 What is POSTMAN Practice
Day 3 Understanding POSTMAN Practice
Day 4 How to create API Request Practice
Day 5-6-7 What is collection? Practice
How to create Collection?
How to Run Collection(Collection Runner)?
How to run Collection remotely with URL
Day 8 What are VARIABLES? Practice
How to create VARIABLES and Refer them?
How to set and get VARIABLES?
Day 9 How to create Environments? Practice
How to create quick Scripts?
How to Debug?
Day 10 What is NEWMAN? Practice
How to run from command line?
Day 11 How to run from JENKINS? Practice
How to create and Manage workspaces ?
Day 12 Data Driven Testing VIA CSV and JSON Practice
Day 13 How to run SOAP Requests Practice
Day 14-15 Interview questions Practice
Webservices

Meaning: - Web Services is the mechanism or the medium of communication through which two applications / machines
will exchange the data irrespective of their architecture and the technology they use.

Web services transfers data between client and server. The client sends a web request to the server and the server then
responds to the client. This response will differ based on the web service request type.

WSDL (Web Service Description Language)

 WSDL is used when Client and Server knows each other.


 Server (Service Provider) publish the interface called WSDL (this is XML document that is used to describe the
functionalities of webservices) which is used by Client.
 Details that are available in the WSDL’s XML file are –
 Origin of the web service
 Header information
 Port type
 Input and output messages
 Each of the information are represented as tag in the WSDL file like
 <types> – XML Schema data types
 <message> – the actual request and response data being communicated
 <portType> – the target/end points where the actual web service is hosted to perform the operation
 <binding>– the protocol information is given for the data format
 <definitions>– the parent tag for the above-mentioned tags

UDDI (Universal Description, Discovery and Integration)

 UDDI is collection of several WSDL – It is universal directory.


 UDDI is useful when Client and Service Provider are not knows each other. Service Provide make its webservice
public so that some client can use it for its own purpose.

Implementing Web Services

SOAP Web Serviceshttps://www.youtube.com/watch?v=sTGgBoFBDAY&list=PLhW3qG5bs-L-aUxyATNOB_L5Qk-a5TfM-&index=4


 Simple Object Access Protocol
 SOAP Web Service = SOAP+WSDL+UDDI
 SOAP web services use the XML file to send and receive the request and hence the data is platform independent
data.
 SOAP uses - HTTP transport protocol.
 SOAP WebService Architecture below.

 XML File has a structure called SOAP messages (which is consists of Envelope, Header and Body)
o Envelope – root element of SOAP Message. This contains Header and Body
o Header- it contains the information about the message , authentication, type, routing info etc.
o Body- it contains the actual data of the request which we have to sent to the server.

REST/RESTful Web Services https://www.youtube.com/watch?v=lyxJQWUymV4&list=PLhW3qG5bs-L81R4w0jyLo95JdFHtaxRp4&index=3

Webservice that communicates / exchange information between 2 appication using REST is called RESTFul WebServices.

 REST means REpresentational State Transfer


 REST is not a protocol, it is architectural style.
 it is an architecture that generally runs over HTTP.
 REST uses simple URL rather than XML.

What are principles of REST architecture or what are useful conditions to make RESTful webservices.

 Uniform Interface
o Resource everything is a resource
o URI any resource/data can be accessed by a URI
URI – is a URL to access the resource of server

Example =
http://example.com/employees/10
Employees= Table
10= id

http://example.com/departments/123/employees

o HTTP make explicit use of HTTP methods


HTTP Methods CRUD
POST C =CREATE =POST http://example.com/employees/10
this will create the data on server of employee id 10
GET R =READ =GET http://example.com/employees/10
this will read the data on server of employee id 10
PUT U =UPDATE =PUT http://example.com/employees/10
this will update the data on server of employee id 10
DELETE D =DELETE = DELETE http://example.com/employees/10
this will delete the data on server of employee id 10

 Stateless – all client – server communications are stateless


o Statelessness means server should not required to store the state of a session. If session is required, then
it should be stored at client side. This make every request from client independent and complete.
 Cacheable – happens at client side
o Cacheable mean when client receives the response data from the server – it contains the tag related to
Cache.
 Cache-Control
 Etag
 Layered System- layers can exist between client and server

Difference between SOAP and REST

SOAP REST
SOAP stands for Simple Object Access Protocol. REST stands for Representational State Transfer
It is a XML based message protocol  REST is not a protocol, it is architectural style.
Invoke services by calling RPC method  Call services via URL Path
Transfer over HTTP/ FTP/ DHCP  Transfer over HTTP only

SOAP web service always make a POST operation REST you can choose specific http methods like
GET,POST,PUT,DELETE.
Day 2

The main reason why we perform API testing to check the logic written by the developer is working as expected or not.
If the logic written by the developer is working as expected, then the developer will convert the logic into User Interface
(UI). So, when you are testing the API’s of any application that time UI is not present or yet to develop.

What is POSTMAN?

 Postman is a API client used to perform API Testing.


 It acts as a client while testing the application developed in RESTful state.
 You can create an environment, write test cases, share APIs,etc.
 Main Features of Postman:
 Managing API collections, environments, tests and sharing
 Import & export API collections
 You can work alone or as a team.
 Maintain history of API requests
 Extended API documentation & monitoring features

When to use POSTMAN?

 Whenever you wish to test your applications behavior for a particular API endpoint, after being
requested by client.
 To view a response the server returns after requesting the API endpoint.
 Customizing the requests made to server, and test the server’s response in different circumstances.

Who uses it?

 Developer
 Tester

HTTP Methods used in POSTMAN


GET Read a specific resource (by an identifier) or a collection of resources.
HEAD Works same as GET, just returns the header.
PUT Update a specific resource (by an identifier) or a collection of resources.
DELETE Remove/delete a specific resource
POST Create a new resource.

HTTP Response Codes for Status


200 Ok
201 Created New resource has been created
204 No Content Success and response body empty. The resource was successfully deleted.
304 Not Modified The client can use cached data
400 Bad Request The request was invalid or cannot be served. The exact error explained in
error payload.
401 Unauthorized The request requires an user authentication
403 Forbidden The server understood the request, but is refusing it or the access is not
allowed.
404 Not found There is no resource behind the URI
405 Method not allowed
422 Unprocessable Entity
500 Internal Server Error
Day 3

POSTMAN TOOL

 Website - https://www.getpostman.com/
 Download link - https://www.getpostman.com/download?platform=win64
 Help and Support - https://learning.getpostman.com/docs/postman/launching_postman/installation_and_updates

Type of Postman Tool

 Native Application - Desktop Application (MAC/WINDOWS/LINUX)


 Chrome Application - Chrome Extension

Difference between Native and Chrome Application?

Postman Native application are built on Electron(open source library for building cross-platform desktop application),
and help to overcome the restriction or what we cannot do on Chrome Application.

 Cookies – In native we can work on cookies directly but in chrome app we need interceptor extension.
 Built-In Proxy – native app comes with built in proxy which can be used to capture network traffic.
 Menu Bar- native apps allows to create Postman Windows and tabs, edit preferences, and can perform many
other tasks. And can update to newer version.
 Restricted headers- native apps let you send headers like Origin and User-Agent.
Navigation in POSTMAN

Sidebar- helps to find and manage the request and collections Sidebar has two category

 History Tab – POSTMAN saves every query we send, those are visible in this area.
 Collection Tab - creates and manages collections from the Collections tab in the sidebar

Header Bar –

New button Creates requests, collections, environments,


documentation, mock servers, and monitors.
Import button 1. Imports Postman collections, environments, WADL,
Swagger, RAML, or cURL into Postman using files, links, or
raw text.
Runner button Opens the collection runner.

New window icon Opens a new "Tab", "Postman Window" or a "Runner


Window".

Workspaces menu Opens the Workspaces menu where you can view personal
and team Workspaces, and create and manage Workspaces.
Interceptor/Proxy icon Manages proxy or Interceptor settings.

IN SYNC status icon 2. Updates the status of your Postman account.


Settings icon 3. Manages Postman app settings and finds other support
resources.
Notifications icon 4. Receives notifications or broadcasts.

User dropdown 5. Displays current user and provides these options: "Profile",
"Account Settings", "Notification Preferences", "Active
Sessions", and "Add a new account".

Status bar

Migrating to the native app

 Login to POSTMAN or not, move to File Settings


 In SETTINGS window select Data and choose “Export Data” or “Import Data”
o Export Data (Bulk Export)- Will help you to dump your all the data into single file
o Import Data (Bulk Import)– will help you import dumped data into POSTMAN (Chrome to Native)
Updating POSTMAN

This can be done by two ways

Or
Day 4

S-ar putea să vă placă și