API AUTOMATION POST FUNCTIONALITY

Share on facebook
Share on twitter
Share on linkedin
An API is a software-to-software interface that enables communication and data exchange between two separate software system. In APIs, applications talk to each other without any user knowledge.

Introduction

  • API – Application Programming Interface
  • An API is a software-to-software interface that enables communication and data exchange between two separate software system. In APIs, applications talk to each other without any user knowledge.
  • This testing is completely different from GUI testing. API testing won’t consider the look and feel of an application.
  • Instead of using standard user inputs and output, in API testing, we’re using software to send calls to an API and get an output (System Response). While testing an API, we need to,
    • Use API Testing Tool to drive the API
    • Write your own script to test the API

Commonly used HTTP Methods:

  • GET: Used to extract the information from the given server. It provides read-only access to the resource.
  • POST: This request used to create a new record/entity.
  • PUT: Used to update an existing resource or creating new resource
  • DELETE: Used to remove a resource.

HTTP Status Response Code:

API Automation

API Automation 

API Process Flow:

API Automation

FRAMEWORK DETAILS:

Framework: POM with TestNG

Language: JAVA

API: Rest Assured

Read Test Data From:  JSON, Property File

Report: Extent 2

API Methods: POST and GET

Authorization: Outh2.

Post Functionality: Manual Execution

Step 1: Add postman extension in chrome.

API Automation

Step 2: Now, open the postman and then navigate into “Authorization” tab

API Automation

Step 3: Now, generate new “Access Token” using type as “OAuth 2”:

Note: Without using access token, we can’t send response to API. To create access key referred this link: Refer to generate access token

API Automation

Step 4: Click the “Get Access Token” button and then provide valid information. Now, click “Request Token”.

API Automation

Step 5: After generating the Access Token, click the “Use Token” button. The generated access token will be used for performing http methods like post, get, delete and so on.

API Automation

Step 6: Now, select POST method and then provide valid URL, JSON content in BODY (The Testdata/metadata vary depending on the object in Salesforce).

API Automation

Step 7: Click the “Send” button and then verify the response message with status code

API Automation Process:

Step 1: Generate Access Token using OAuth2.0

API Automation

Step 2: Perform Post Method using multipart: (Send Request to API for creating a record is salesforce)

API Automation

Step 3: Get Method (Receiving Response)

About MST

At MST Solutions our cornerstone is to adapt, engage and create solutions which guarantee the success of our clients. The talent of our team and experiences in varied business verticals gives us an advantage over other competitors.

Recent Articles

Mobile Responsive Testing

Mobile Responsive Testing is simply a Testing Process performed to make sure that your website or an app is working appropriately on all types of devices.
Whether it an app or website, they need to ensure that they are accessible from any device, anytime, anywhere.

Read Article »

Work with us.

Our people aren’t just employees, they are key to the success of our business. We recognize the strengths of each individual and allow them time and resources to further develop those skills, crafting a culture of leaders who are passionate about where they are going within our organization.