Reuse Your Functional API Tests as Load API Tests in 7 Steps

DZone 's Guide to

Reuse Your Functional API Tests as Load API Tests in 7 Steps

Have those functional tests from your API development cycle laying around? We take a look at how you can re-purpose them as load tests quickly and easily.

· Performance Zone ·
Free Resource

The technological age of agility has improved product quality, time to release and work processes. It has also created new positions in R&D like DevOps, and new working methodologies like Scrum. Developers now are completing end-to-end cycles by themselves in short sprints, and constantly releasing new fixes and features.

Therefore, one of the new key needs by developers is tools and methods to save them time. In testing, this need has created a movement from proprietary testing tools that require high expertise, to open-source. Instead of counting on a Center of Excellence to get test results, they are now counting on themselves and on the open-source community for that. (To learn how to convert your LoadRunner scripts to open-source, click here).

Another way for developers to save time is to reuse their existing scripts for as many requirements as possible. This saves the time of creating a new script, and also enables automation. Automation is the developers’ way out of painstaking work.

So instead of creating one script for API functional testing and another for API load testing, there are certain cases where the same script can be used for both. Whether with open-source tools like Apache JMeter, Gatling or Locust, or with automation frameworks like Taurus, a simple change in the script can be very useful. 

1. Choose a load testing tool. Not sure which one to choose? Here’s a useful guide.

2. Create your test scenario. If you want to learn how to create a scenario with JMeter, click here.

3. Set the number of users in the Thread Group to 1 and the Loop Count to 1.

Image title

4. Run the test.

5. Now check your test results. This was your functional test.

6. If your test results were satisfactory, change the number of users in your Thread Group according to your target load. We recommend ramping-up slowly.

Image title

7. Run your test and check your results. This was your load test.

That’s it! Open-source testing provides you with a lot of options. If you want to automatically run your tests, you can do so with open-source  Taurus. Taurus supports a large number of open-source load testing tools.

If you need more abilities, like running your API tests in the cloud, or getting your API tests automatically created, you can use BlazeMeter. Learn how from this webinar.

Learn load testing with JMeter from our JMeter academy.

api, api testing, functional testing, load testing, performance

Published at DZone with permission of Noga Cohen , DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

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

{{ parent.tldr }}

{{ parent.urlSource.name }}