SlideShare a Scribd company logo
{
Introduction to APIs & how to
automate APIs testing with
selenium web driver?
An application-programming interface(API) consists of a set of
standards and programming instructions for accessing a Web tool
or Web-based software application. Application Program interface
is a set of protocols, routines and tools required for building
software applications. An API specifies the way in which the
software components should interact. Additionally, APIs are used
when the graphical user interface(GUI) components are to be
programmed. A good API provides all the building blocks and
makes it easier to develop a program. A programmer puts all the
building blocks together.
Introduction
Different types of APIs are available for operating systems,
applications or websites. For example, ‘Windows’ has many API
sets that are being used by the system hardware and applications
i.e. when users copy and paste text from one application to another,
it is the API that makes it work. Most of the operating
environments, such as MS-Windows also provides APIs which
allows the programmers to write applications that are consistent
with the operating environment. Today, the websites also specify
the APIs. For example, with the help of Amazon or eBay APIs,
developers can create specialized web stores by using the existing
retail infrastructure. Third-party software developers can also use
the Web APIs so as to create software solutions for the end-users.
An API is not a user interface but a software-to-software interface.
With APIs, applications are allowed to communicate with each
other without any user intervention. When you buy movie tickets
online and enter your credit card information, Web site makes use
of an API to send your credit card information to a remote
application that verifies whether your information is correct or not.
Once the payment gets confirmed, the remote application sends
back a response to the Web site notifying that it is 'OK' to issue the
tickets.
WebDriver is one of the most powerful and popular tools of
Selenium toolkit. WebDriver is an extended version to Selenium RC
with surplus advantages and it overcomes many of its limitations.
Unlike Selenium IDE, WebDriver provides support to many latest
browsers and platforms. In case of WebDriver, selenium server isn’t
required to be started prior to the test scripts execution unlike
Selenium RC. Selenium 2.0 is an aggregation of Selenium RC with
WebDriver API. Selenium was developed so as to support dynamic
web pages and Ajax calls. It also supports various drivers to
perform web based mobile testing.
Introduction to Selenium WebDriver
IT enterprises globally are implementing various automation
solutions in order to provide effective and efficient software testing
services. New and innovative approaches have been developed for
test automation utilizing Selenium framework, thereby helping the
enterprises to improve their service quality and thereby reducing
the costs. Keeping this in mind, Selenium framework has been
developed as it helps the testing teams to automate the validations
of URL based APIs.
Selenium WebDriver Framework for
API Testing
Selenium Based Automation Regression Suite: Selenium framework
is a data vbdriven solution which consists of i) Java based Driver
scripts ii) Frameworks methods created as per method types of APIs.
1. Selenium framework takes considerably less time to prepare
test data or to validate each scenario in comparison to manual
testing.
2. For the preparation of the data and to validate 350 scenarios, it
takes approximately 7 man days per resource. However, with the
implementation of the selenium framework the time gets
reduced to 1.5 hours (approximately).
3. It is easy to develop the Selenium framework and the test
cases can be maintained effortlessly.
4. It is possible to integrate the Selenium framework with
Continuous Integration(CI) build deployment process.
Benefits of Selenium Framework
public static String PostRequest(String PostRequestURL,String Parameters) throws
Throwable {
String responseData="";
System.setProperty("http.proxyHost", "Proxy server IP"); // Enter your proxy name here
System.setProperty("http.proxyPort", "Proxy server port");
HttpPost POSTrequest = new HttpPost(PostRequestURL);
StringEntity param =new StringEntity(Parameters);
POSTrequest.addHeader("content-type","application/json");
POSTrequest.setEntity(param);
HttpResponse response = httpClient.execute(POSTrequest);
BufferedReader rd = new
BufferedReader(newInputStreamReader(response.getEntity().getContent()));
int statuscode=response.getStatusLine().getStatusCode();
Assert.assertTrue(statuscode==200, "Failed : HTTP error code :"+statuscode);
responseData=rd.readLine();
System.out.println("output is =" +responseData);
return responseData;
}
Selenium framework simplifies API validation by building the test cases. The same can be
leveraged for a selenium driven automation engine to validate and update the test execution
results.
Example
Introduction to APIs & how to automate APIs testing with selenium web driver?

More Related Content

PPT
Postman.ppt
PDF
API Testing
PPTX
Api Testing
PPTX
API Testing Using REST Assured with TestNG
PDF
How to Automate API Testing
PDF
PPT
Selenium
PPTX
Api testing
Postman.ppt
API Testing
Api Testing
API Testing Using REST Assured with TestNG
How to Automate API Testing
Selenium
Api testing

What's hot (20)

PPT
Test Automation Framework Designs
PPTX
Spring boot
PDF
4 Major Advantages of API Testing
PPTX
Api testing
PDF
Selenium Page Object Model Using Page Factory | Selenium Tutorial For Beginne...
PPSX
API Test Automation
PPTX
Saving Time By Testing With Jest
PDF
Postman: An Introduction for Testers
PPTX
POSTMAN.pptx
PPTX
Rest assured
PPTX
Test Design and Automation for REST API
PDF
An Introduction To Automated API Testing
PDF
Postman: An Introduction for Developers
PDF
API TESTING
PPT
Loadrunner presentation
PPTX
Selenium- A Software Testing Tool
PPTX
API Automation Testing Using RestAssured+Cucumber
PPT
QSpiders - Automation using Selenium
PPTX
API Testing for everyone.pptx
PPTX
What is an API
Test Automation Framework Designs
Spring boot
4 Major Advantages of API Testing
Api testing
Selenium Page Object Model Using Page Factory | Selenium Tutorial For Beginne...
API Test Automation
Saving Time By Testing With Jest
Postman: An Introduction for Testers
POSTMAN.pptx
Rest assured
Test Design and Automation for REST API
An Introduction To Automated API Testing
Postman: An Introduction for Developers
API TESTING
Loadrunner presentation
Selenium- A Software Testing Tool
API Automation Testing Using RestAssured+Cucumber
QSpiders - Automation using Selenium
API Testing for everyone.pptx
What is an API
Ad

Viewers also liked (11)

PPTX
Selenium Testing
ODP
MongoDB : The Definitive Guide
PPT
Advanced Topics On Sql Injection Protection
PPTX
Top 5 Javascript Frameworks for Web and Mobile App Development
PPTX
Software Automation Testing Introduction
PPTX
Selenium topic 3 -Web Driver Basics
DOCX
Selenium WebDriver FAQ's
PPTX
Introduction to Selenium Web Driver
PPT
Java Basics for selenium
PPTX
Automation Testing by Selenium Web Driver
PDF
The What, Why and How of (Web) Analytics Testing (Web, IoT, Big Data)
Selenium Testing
MongoDB : The Definitive Guide
Advanced Topics On Sql Injection Protection
Top 5 Javascript Frameworks for Web and Mobile App Development
Software Automation Testing Introduction
Selenium topic 3 -Web Driver Basics
Selenium WebDriver FAQ's
Introduction to Selenium Web Driver
Java Basics for selenium
Automation Testing by Selenium Web Driver
The What, Why and How of (Web) Analytics Testing (Web, IoT, Big Data)
Ad

Similar to Introduction to APIs & how to automate APIs testing with selenium web driver? (20)

PPTX
A Definitive Guide to Mastering Selenium WebDriver Automation Effectively.pptx
PPTX
Python selenium
PPTX
Test Automation Using Selenium
PDF
Ijetcas14 413
PPTX
An overview of selenium webdriver
PDF
anoverviewofseleniumwebdriver-160407055026 (pdf.io).pdf
PPT
Google App Engine - Overview #1
PPTX
Introduction to the Selenium_Session1.pptx
PDF
Designing an effective hybrid apps automation framework
PPTX
Latest Web development technologies 2021
PDF
App Service Web
PDF
7.pdf
PPTX
Web driver interface
PPTX
Selenium
PPTX
Selenium Web Driver Tutorial for Cross Browser Testing
PPTX
Test Automation and Selenium
PDF
Introduction to Selenium Webdriver - SpringPeople
PDF
Introduction to Automation Testing and Selenium overiew
PDF
Introduction to Selenium Automation
PPTX
Java ee introduction
A Definitive Guide to Mastering Selenium WebDriver Automation Effectively.pptx
Python selenium
Test Automation Using Selenium
Ijetcas14 413
An overview of selenium webdriver
anoverviewofseleniumwebdriver-160407055026 (pdf.io).pdf
Google App Engine - Overview #1
Introduction to the Selenium_Session1.pptx
Designing an effective hybrid apps automation framework
Latest Web development technologies 2021
App Service Web
7.pdf
Web driver interface
Selenium
Selenium Web Driver Tutorial for Cross Browser Testing
Test Automation and Selenium
Introduction to Selenium Webdriver - SpringPeople
Introduction to Automation Testing and Selenium overiew
Introduction to Selenium Automation
Java ee introduction

More from BugRaptors (20)

PPTX
Performance Testing - A Catalyst In Software Testing Landscape
PDF
13 Things To Keep In Mind For Enhanced Mobile App UI/UX Design
PPTX
Why Companies Need to Leverage ERP Testing Services?
PPTX
BFSI Testing Solutions - To Streamline BFSI Sector
PPTX
Media Streaming App Testing - Knowing The Significance
PPTX
Manual Testing - Developing A Quick Perspective
PDF
Regression Testing - An Overview
PDF
Cloud Testing - Reinforcing Cloud Technology
PPTX
Importance of Performance Testing.pptx
PDF
Media & Entertainment Testing Services –BugRaptors
PPTX
Usability Testing - Connect With Target Audience With Perfect UX
PDF
Tips To Follow For A Simple QA Process
PDF
CRM Testing Services - Ensure Smooth Functioning of Complex CRM Workflows
PPTX
Test Automation - Everything You Need To Know
PPTX
Stress testing ERP frameworks
PDF
Top 10 Automation Testing Tools
PPTX
Software Testing Trends For 2021
PDF
Banking App Testing - To Evaluate Performance
PDF
Test Automation Trends For 2021
PPTX
ERP Testing Strategy For Large Scale Organizations
Performance Testing - A Catalyst In Software Testing Landscape
13 Things To Keep In Mind For Enhanced Mobile App UI/UX Design
Why Companies Need to Leverage ERP Testing Services?
BFSI Testing Solutions - To Streamline BFSI Sector
Media Streaming App Testing - Knowing The Significance
Manual Testing - Developing A Quick Perspective
Regression Testing - An Overview
Cloud Testing - Reinforcing Cloud Technology
Importance of Performance Testing.pptx
Media & Entertainment Testing Services –BugRaptors
Usability Testing - Connect With Target Audience With Perfect UX
Tips To Follow For A Simple QA Process
CRM Testing Services - Ensure Smooth Functioning of Complex CRM Workflows
Test Automation - Everything You Need To Know
Stress testing ERP frameworks
Top 10 Automation Testing Tools
Software Testing Trends For 2021
Banking App Testing - To Evaluate Performance
Test Automation Trends For 2021
ERP Testing Strategy For Large Scale Organizations

Recently uploaded (20)

PDF
Empathic Computing: Creating Shared Understanding
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PDF
Modernizing your data center with Dell and AMD
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PPTX
MYSQL Presentation for SQL database connectivity
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PPTX
A Presentation on Artificial Intelligence
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
NewMind AI Monthly Chronicles - July 2025
Empathic Computing: Creating Shared Understanding
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
The AUB Centre for AI in Media Proposal.docx
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
Modernizing your data center with Dell and AMD
Chapter 3 Spatial Domain Image Processing.pdf
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
MYSQL Presentation for SQL database connectivity
CIFDAQ's Market Insight: SEC Turns Pro Crypto
Digital-Transformation-Roadmap-for-Companies.pptx
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Diabetes mellitus diagnosis method based random forest with bat algorithm
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
A Presentation on Artificial Intelligence
Review of recent advances in non-invasive hemoglobin estimation
NewMind AI Monthly Chronicles - July 2025

Introduction to APIs & how to automate APIs testing with selenium web driver?

  • 1. { Introduction to APIs & how to automate APIs testing with selenium web driver?
  • 2. An application-programming interface(API) consists of a set of standards and programming instructions for accessing a Web tool or Web-based software application. Application Program interface is a set of protocols, routines and tools required for building software applications. An API specifies the way in which the software components should interact. Additionally, APIs are used when the graphical user interface(GUI) components are to be programmed. A good API provides all the building blocks and makes it easier to develop a program. A programmer puts all the building blocks together. Introduction
  • 3. Different types of APIs are available for operating systems, applications or websites. For example, ‘Windows’ has many API sets that are being used by the system hardware and applications i.e. when users copy and paste text from one application to another, it is the API that makes it work. Most of the operating environments, such as MS-Windows also provides APIs which allows the programmers to write applications that are consistent with the operating environment. Today, the websites also specify the APIs. For example, with the help of Amazon or eBay APIs, developers can create specialized web stores by using the existing retail infrastructure. Third-party software developers can also use the Web APIs so as to create software solutions for the end-users.
  • 4. An API is not a user interface but a software-to-software interface. With APIs, applications are allowed to communicate with each other without any user intervention. When you buy movie tickets online and enter your credit card information, Web site makes use of an API to send your credit card information to a remote application that verifies whether your information is correct or not. Once the payment gets confirmed, the remote application sends back a response to the Web site notifying that it is 'OK' to issue the tickets.
  • 5. WebDriver is one of the most powerful and popular tools of Selenium toolkit. WebDriver is an extended version to Selenium RC with surplus advantages and it overcomes many of its limitations. Unlike Selenium IDE, WebDriver provides support to many latest browsers and platforms. In case of WebDriver, selenium server isn’t required to be started prior to the test scripts execution unlike Selenium RC. Selenium 2.0 is an aggregation of Selenium RC with WebDriver API. Selenium was developed so as to support dynamic web pages and Ajax calls. It also supports various drivers to perform web based mobile testing. Introduction to Selenium WebDriver
  • 6. IT enterprises globally are implementing various automation solutions in order to provide effective and efficient software testing services. New and innovative approaches have been developed for test automation utilizing Selenium framework, thereby helping the enterprises to improve their service quality and thereby reducing the costs. Keeping this in mind, Selenium framework has been developed as it helps the testing teams to automate the validations of URL based APIs. Selenium WebDriver Framework for API Testing
  • 7. Selenium Based Automation Regression Suite: Selenium framework is a data vbdriven solution which consists of i) Java based Driver scripts ii) Frameworks methods created as per method types of APIs.
  • 8. 1. Selenium framework takes considerably less time to prepare test data or to validate each scenario in comparison to manual testing. 2. For the preparation of the data and to validate 350 scenarios, it takes approximately 7 man days per resource. However, with the implementation of the selenium framework the time gets reduced to 1.5 hours (approximately). 3. It is easy to develop the Selenium framework and the test cases can be maintained effortlessly. 4. It is possible to integrate the Selenium framework with Continuous Integration(CI) build deployment process. Benefits of Selenium Framework
  • 9. public static String PostRequest(String PostRequestURL,String Parameters) throws Throwable { String responseData=""; System.setProperty("http.proxyHost", "Proxy server IP"); // Enter your proxy name here System.setProperty("http.proxyPort", "Proxy server port"); HttpPost POSTrequest = new HttpPost(PostRequestURL); StringEntity param =new StringEntity(Parameters); POSTrequest.addHeader("content-type","application/json"); POSTrequest.setEntity(param); HttpResponse response = httpClient.execute(POSTrequest); BufferedReader rd = new BufferedReader(newInputStreamReader(response.getEntity().getContent())); int statuscode=response.getStatusLine().getStatusCode(); Assert.assertTrue(statuscode==200, "Failed : HTTP error code :"+statuscode); responseData=rd.readLine(); System.out.println("output is =" +responseData); return responseData; } Selenium framework simplifies API validation by building the test cases. The same can be leveraged for a selenium driven automation engine to validate and update the test execution results. Example