Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Getting Started With API Functional Testing With BlazeMeter

DZone's Guide to

Getting Started With API Functional Testing With BlazeMeter

Performing functional testing on your APIs earlier in the process will aid in your team's ability to deliver high-quality APIs. Read on to learn how this tool can help.

· Integration Zone ·
Free Resource

SnapLogic is the leading self-service enterprise-grade integration platform. Download the 2018 GartnerMagic Quadrant for Enterprise iPaaS or play around on the platform, risk free, for 30 days.

As we move towards more Agile Shift-left software development processes like continuous integration and delivery, developers need to be able to quickly and efficiently run tests during the entire delivery cycle.

One downfall to UI functional tests is they are slow. This makes them less than ideal for letting developers know quickly if their code has broken the latest build or not. API functional tests, on the other hand, tend to be faster. API functional tests also tend to run more reliably than GUI functional tests because changes in the user interface usually occur more frequently then changes on the API level. Therefore GUI tests tend to be more brittle than API level tests.

What Is API Functional Testing?

While most functional testing involves testing a user interface like a web page or application, API testing involves bypassing a user interface and communicating directly with an application by making calls to its APIs.

API Functional Testing consists of bypassing the UI and sending a request directly to an application's backend or service and receiving a response while validating the response to ensure things are working as we expect them to.

How Does API Functional Testing Work in Blazemeter?

We've just launched a new UI that allows you to easily create API Functional Tests. In this blog post, I will explain to you how to create your first API Functional Test with BlazeMeter.

All we need to get started is an API endpoint to test. You can either use your own public API (we'll explain how to run an API Functional Test behind the on-premise/behind the firewall in a separate blog post) or use the API of our demo test system. In the example below, I will use a simple GET request of the REST API of our demo test system.

API Functional Testing for Non-Blazemeter Users

1. Go to https://www.blazemeter.com/api-functional-testing.

2. Enter https://api.demoblaze.com/entries and HTC One in the Assert field then click Start Test.

API Functional Testing With Your Current Blazemeter Account

1. Click the Create Test button.

2. Then click API Functional Test.

3. Click on Request Name and enter Get all entries.

4. Enter https://api.demoblaze.com/entries in the URL field.

5. Click on Assertions, select Regex from the Choose type drop-down, then select Body from the Subject drop-down, and simply enter HTC One in the Regular Expression field. Then click the Add button.

6. Let's give it a try - click Run Test.

The test should run, and, in the report, you will be able to see all the details about the request as well as the response, such as request and response size, response code, response time and latency, as well as body, headers, and assertions.

Why Use BlazeMeter for API Functional Testing?

  • BlazeMeter has an intuitive UI to easily create API Functional Tests without coding.
  • You can use the same tool to create performance tests and massive scale load tests for your API in a consistent way.
  • BlazeMeter is based on open source technology and built for test automation, through dedicated Continuous Integration plugins for JenkinsTeamCity, and Bamboo and any other CI system through our CLI tool
  • BlazeMeter provides comprehensive detailed reporting on request level as well as historic trend reports. Collaborate and share test results with teams.

Download A Buyer's Guide to Application and Data Integration, your one-stop-shop for research, checklists, and explanations for an application and data integration solution.

Topics:
performance testing ,functional api testing ,api testing ,continuous testing ,integration

Published at DZone with permission of

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}