Sunday, December 11, 2016

API Monitoring and Testing

Application Programming Interfaces (APIs) testing is different than other testing as GUI is not available and this won't concentrate on look and feel of the application. API testing involves testing APIs directly. It enables communication and data exchange between two separate software systems and as part of the end-to-end transactions exercised during integration testing.

API testing commonly includes testing REST APIs or SOAP web services with JSON or XML message payloads being sent over HTTP, HTTPS, JMS. Since APIs lack a GUI, API testing is performed at the message layer.

Summary - RESTful vs SOAP Web Service

SOAP:
--XML based protocol
--Uses WSDL for communication between consumer and provider
--Does not return human readable result
--Transfer over HTTP, SMTP, FTP, etc.
--Javascript can call SOAP but difficult to implement
--Performance is not great compared to REST
--SOAP web services can be tested through programs or software such as Soap UI.


REST:
--Architectural style protocol
--Uses XML or JSON to send and receive data
--Result is readable which is just plain XML or JSON
--Transfer is over HTTP only
--Easy to call from Javascript
--Performance is better than SOAP. Amazon and Google are moving their APIs from SOAP to REST.
--REST can be easily tested through CURL command, Browsers and extensions such as Chrome Postman.


There are multiple API testing tools available
  • SoapUI
  • Runscope
  • Postman (Chrome Extension)
  • Advanced REST Client (Chrome Extension)
  • Insomnia REST Client (Chrome Extension)
Suppose, there is a checkbox in user registration form and the system using API function which receives input as date range and return a list of users that was registered with checkbox marked at that time interval.

Input: Date interval (e.g, fromdate=2016-12-01&todate=2016-12-15)
Output: list of users registered that time interval with checkbox marked

First of all, install any of the API testing tools and here i will be using SoapUI / Postman / Insomnia / Advanced REST Client.

Download SoapUI from here according to your machine. Other Insomnia / Advanced REST Client can installed from google chrome extensions.


1. Open SOAP UI application


2. Create REST project and put request URL

 
3. Authenticate using Username and Password

Authentication is stated as the act of confirming the identity of API consumer. After authenticated, they are usually authorized to get access to desired APIs
  • Authentication is used to determine who the user of an API is.
  • Authorization is used to determine what resources the identified user has access to. 

There are multiple standards and technologies available for authenticating users, for example;
  • Form-based - Web/HTML based authentication that commonly uses HTTP cookies.
  • Basic/Digest - Uses HTTP headers to identify users.
  • OAuth 1.x/2


4. Submit the request



 See image from Insomnia



Now you can move to advanced things :)



Wednesday, November 30, 2016

What should consider before implement Test Automation

Suppose, you are working in a project as manual tester and you are enjoying the working. One day, your QA manager share client's thinking and they are expecting to integrate Automation Testing in the projects as a regression test. So, your manager requested you to plan for Automation Testing. Now it's your turn how you can manage and plan for automation efficiently.

Before implement test automation, you have to face some of the questions and have to consider some of the factors whether it is best fit for the current system or not.
  • Are you thinking of 100% automation?
  • Is your application is stable enough to automate further testing work?
  • Automate testing procedure when you have lot of regression work
  • Think about skilled resources
  • Identify what test cases to automate
    • Repetitive tasks
    • Stable enough application
    • Complex calculation
    • Which require regular set up of environment
    • Things which are difficult for human
    • Task requiring multiple data sets
    • Apply common sense!

Tuesday, November 29, 2016

Test Automation Introduction

As a career of software tester, we all need to know the basic understanding of software test automation. There are good numbers of tools (Selenium, Telerik Test Studio, Robotium, QTP, TestComplete) to do the automation and there are multiple language (Java, C-Sharp, Python, Ruby) support.

Here, I will go further with Selenium and the language is Java. Selenium is a software testing framework for web applications. There are multiple components (Selenium IDE, Selenium RC, Selenium WebDriver, Selenium Grid) of Selenium. First one, Selenium IDE which is implemented as a Firefox Add-On, and it allows recording, editing, and debugging tests. The work around of Selenium IDE is not vast. It is less maintained and is only compatible with Selenium RC, which is deprecated product right now.

Selenium WebDriver (Selenium 2.0) implemented as a successor of Selenium RC. It has browser-specific browser driver, which launch the browser, sends commands, and retrieves results from browser application. Selenium 2.0 is supported in Python, Ruby, Java, and C#. So, we can write code according to our familiar languages.

Happy Coding! :)

Blazemeter plugin