In my previous article, we discussed how to automate and validate APIs using postman. In this article, we will see how to validate a JSON schema using postman.

What is JSON schema?

JSON Schema is a specification for defining the structure of JSON data i.e. JSON request body and response in case of APIs. Basically, JSON schema defines various keys and their values and certain constraints on the values.

The various important keywords that are used in the JSON schema are as follows:

Postman is an excellent tool for testing APIs. It can be used by backend developers, web developers, mobile developers, and QA testers. Postman is not only used to test APIs manually but also is a great automation tool.

You can write automation scripts using JavaScript and write assertions in chai.js, which is a BDD/TDD assertion library. Postman allows running tests headlessly with Newman and adds to your build pipeline. You can also export test reports using Junit and Newman. The scope of this article is limited to writing test scripts only.

Writing Test Scripts

You can add Javascript code in two places in…

What is API Mocking?

A mock API imitates a real API by providing realistic responses for API requests. These APIs can be on your local computer or hosted on the public internet. It basically fakes the behaviour of real API.

Why API Mocking?

Photo by Shahadat Rahman on Unsplash

Selenium 4 has added native support for Chrome DevTools APIs. With these new APIs, we can now monitor and intercept HTTP requests and HTTP responses, simulate network speed, basic authentication, validate and clear application cookies and cache, accessing console logs and performance metrics, and a lot more.

We will initialize devtools session and webdriver before starting the test

Monitoring HTTP Requests

To monitor the request we need to pass the event Network.requestWillBeSent to the listener. This event is fired when the page is about to send an HTTP request.

After this, we use a listener to listen to the various HTTP requests…

Inheritance in Java: A Brief

One of the core principles of Object-Oriented Programming — inheritance — enables us to reuse existing code or extend an existing type. Simply put, in Java, a class can inherit another class and multiple interfaces, while an interface can inherit other interfaces. When you inherit from an existing class, you can reuse methods and fields of the parent class. Moreover, you can add new methods and fields to your current class also.

Inheritance represents the IS-A relationship or a parent-child relationship. Consider a parent class Animal and child class Dog.

public class Animal {
public void move(){…

Photo by Ilya Pavlov on Unsplash

Upcasting in Java is done implicitly. Consider a base class Animal and child class Dog and Cat.

public class Animal {
public void move()
System.out.println("Animals can move");
public void sleep()
System.out.println("Animals can sleep");

Dog class is a subclass of Animal

public class Dog extends Animal {public void move()
System.out.println("Dogs can move");
public void bark()
System.out.println("Dogs can bark");

Cat class is a subclass of Animal

public class Cat extends Animal {public void move()
System.out.println("Cats can move");
public void meow()
System.out.println("Cats can meow");

Using the…

Deepak Attri

Quality Assurance Engineer | JAVA | API Testing | Mobile Testing | Web Testing | Performance Testing

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store