Katalon Studio- API Automation

               

                                  #############Work is IN PROGRESS for this page##########

                                        ######Only links in Blue color are completed.##########

We are going to learn how to achieve API Automation using Katalon Studio. Click on each topic below to learn.


REST API Automation
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

 1. What is REST API?   

2. REST API Explained by Example 

3. Introduction to REST API Automation project in Katalon Studio.

 

SOAP API Automation ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 

A REST API (also known as RESTful API) is an application programming interface (API or web API) that conforms to the constraints of REST architectural style and allows for interaction with RESTful web services. REST stands for representational state transfer and was created by computer scientist Roy Fielding.

An API is a set of definitions and protocols for building and integrating application software. It’s sometimes referred to as a contract between an information provider and an information user—establishing the content required from the consumer (the call) and the content required by the producer (the response). For example, the API design for a weather service could specify that the user supply a zip code and that the producer reply with a 2-part answer, the first being the high temperature, and the second being the low.  

In other words, if you want to interact with a computer or system to retrieve information or perform a function, an API helps you communicate what you want to that system so it can understand and fulfill the request. 

You can think of an API as a mediator between the users or clients and the resources or web services they want to get. It’s also a way for an organization to share resources and information while maintaining security, control, and authentication—determining who gets access to what. 

Another advantage of an API is that you don’t have to know the specifics of caching—how your resource is retrieved or where it comes from.

REST::


REST is a set of architectural constraints, not a protocol or a standard. API developers can implement REST in a variety of ways.

When a client request is made via a RESTful API, it transfers a representation of the state of the resource to the requester or endpoint. This information, or representation, is delivered in one of several formats via HTTP: JSON (Javascript Object Notation), HTML, XLT, Python, PHP, or plain text. JSON is the most generally popular programming language to use because, despite its name, it’s language-agnostic, as well as readable by both humans and machines. 

Something else to keep in mind: Headers and parameters are also important in the HTTP methods of a RESTful API HTTP request, as they contain important identifier information as to the request's metadata, authorization, uniform resource identifier (URI), caching, cookies, and more. There are request headers and response headers, each with their own HTTP connection information and status codes.

In order for an API to be considered RESTful, it has to conform to these criteria:

 

          Client–server A client-server architecture made up of clients, servers, and resources, with requests managed through HTTP. By separating the user interface concerns from the data storage concerns, we improve the portability of the user interface across multiple platforms and improve scalability by simplifying the server components. 

        Stateless Stateless client-server communication, meaning no client information is stored between get requests and each request is separate and unconnected.
Each request from client to server must contain all of the information necessary to understand the request, and cannot take advantage of any stored context on the server. Session state is therefore kept entirely on the client. 

        Cacheable Cacheable data that streamlines client-server interactions.Cache constraints require that the data within a response to a request be implicitly or explicitly labeled as cacheable or non-cacheable. If a response is cacheable, then a client cache is given the right to reuse that response data for later, equivalent requests 

        Uniform interface  A uniform interface between components so that information is transferred in a standard form. By applying the software engineering principle of generality to the component interface, the overall system architecture is simplified and the visibility of interactions is improved. In order to obtain a uniform interface, multiple architectural constraints are needed to guide the behavior of components. REST is defined by four interface constraints: 

  •  Identification of resources-resources requested are identifiable and separate from the representations sent to the client. 
  • manipulation of resources through representations-resources can be manipulated by the client via the representation they receive because the representation contains enough information to do so
  • self-descriptive messages-self-descriptive messages returned to the client have enough information to describe how the client should process it. 
  • hypermedia as the engine of application state-hypertext/hypermedia is available, meaning that after accessing a resource the client should be able to use hyperlinks to find all other currently available actions they can take. 
 
        Layered system A layered system that organizes each type of server (those responsible for security, load-balancing, etc.) involved the retrieval of requested information into hierarchies, invisible to the client. 
 
        Code on demand (optional)  The ability to send executable code from the server to the client when requested, extending client functionality. REST allows client functionality to be extended by downloading and executing code in the form of applets or scripts. This simplifies clients by reducing the number of features required to be implemented first.

 

Though the REST API has these criteria to conform to, it is still considered easier to use than a prescribed protocol like SOAP (Simple Object Access Protocol), which has specific requirements like XML messaging, and built-in security and transaction compliance that make it slower and heavier. 

In contrast, REST is a set of guidelines that can be implemented as needed, making REST APIs faster and more lightweight, with increased scalablity—perfect for Internet of Things (IoT) and mobile app development................ Click To read more

 

2. REST API Explained by Example                                         🖯Go To Index

Any working software typically could consists of 3 layers. 1. A front end/GUI which is for end user to use 2. A business layer where REST APIs could be designed and used as per business rules and 3. A Data base that stores all the information. The APIs that are developed at business layers can be exposed to a third party as well who wanted to access some information that is originally meant for another client. In the following case Face book as a third party client can be exposed with the API that is originally designed for Orange HRM. This satisfies the 1 of 6 rules, i.e. Code on Demand rule of REST.

 

 

No comments:

Post a Comment