BreadcrumbHomeResourcesBlog How To Achieve Continuous API Testing With BlazeMeter August 19, 2019 How to Achieve Continuous API Testing With BlazeMeterAPI TestingBy Keith PuzeyContinuous testing means testing our APIs both pre-production and post-production (shift right testing). Testing doesn’t stop once we hit production. An API going down can have a dramatic effect on your site and its functionality, so real continuous API testing has to include API Monitoring.Table of Contents: What is Continuous API Testing? Continuous API Testing and Monitoring with BlazeMeterWhat is Continuous API Testing?Continuous API testing means testing your API’s both pre-production and post-production continuously. Real continuous API testing must also include API monitoring.Historically, testing would take place only at the GUI level, and only at the end of the development process. When a developer would finish their work they would hand it off to the QA team. The engineers had limited time so they would test the code at the highest level - the GUI. This would cover both the front-end and back-end development.In the age of Agile, testing must take place at a lower level, i.e at the API level. Developers can even do it themselves. API testing, because “API contracts” can even be created before development is complete. This means developers can validate their code based on pre-written tests (aka Test Driven Development).Continuous API Testing and Monitoring with BlazeMeterWith BlazeMeter’s new Continuous Testing functionality, you can test and monitor your APIs throughout the entire SDLC. I’ll talk you through how to do it.3 Easy Ways to Run API Tests in BlazeMeterThere are several easy ways to create an API Test with BlazeMeter.1. You can simply create it within the UI.2. Toggle to add your own script in Taurus.3. Or you can import from file types like JMeter and Swagger.Now these tests can be data-driven, if we look at the scenario level in the next screenshot data can be imported from a CSV file and variables can be defined at a scenario level to be used by all of the tests within the scenario.Now we click Run Test.You can see all your API test results here. You can also see more detailed reporting.We can also look for the content of the response to validate that the data is correct within the API Test.API Monitoring With BlazeMeterHaving an API down can be devastating to your business. We need to be able to understand not only “Is the API down” but also, if the vendor sticking to the SLA they supplied.We don’t always have access to the 3rd party infrastructure, so we need a way to be alerted if that third-party API is no longer available.We can check this in the API Monitoring screen of the BlazeMeter platform.You can click on the test itself within the application to look at the output.Here we sent a request, got back a “200”, and we can see the details of the response, both for passed or failed API tests, as in the example below.You can also enable the scheduler to easily run API Monitoring tests on a specific API at regular intervals.BlazeMeter’s API Monitoring feature provides access to enterprise-level reporting so that you can continuously monitor and track multiple reports, that can then easily be shared with other users in your workspace.These reports show:Average response rateSuccess rateYou can change the time frame to adjust the viewYou can also drill into the failures to better understand what the problem was.You can connect the monitoring features to your daily workflow solutions to be notified if an API goes down.Current integrations include:SlackPagerdutyAWS CodePipelineDatadogHipchatGhost InspectorJenkinsBottom LineAn API-first strategy requires a strong testing pipeline. Continuous API testing needs an intentional process that makes sure all the systems work together. Breaking down the testing process into three phases; writing good tests, running tests both pre and post-production and API monitoring allows you to continuously test your APIs. This process ensures that your apps are always on and performing at their best. START TESTING NOW
Keith Puzey Automation Tester Keith is a member of the customer-facing BlazeMeter engineering team and has specialised in test and release automation for over 10 years.