Search code examples
automated-testsrestweb-api-testing

How automate API testing for rest API built using Django Rest framework


I want to automate testing of Rest API built using DRF. This automation should run the test cases every 2 minutes and this has to run continuously not in local machine(API is deployed in AWS). If there is any test cases failure then it has to record that failure in log report. This can be any service type. I am using Postman now to run test cases since it is free plan I am using, so have limited API calls and monitors in postman don't have minute wise running. please help!! How can I do this?


Solution

  • Yes,

    After some research and help of my mentors I found a way to automate API testing.

    1. Coding part: I have a python script which uses requests package to call the API and then I am using some conditions to ensure the response is behaving according to the requirements. few example test cases are response status code, response time and schema test.
    2. Automation: I am using AWS lambda function and AWS cloud event bridge to automate and schedule the execution of this script on required time intervals.
    3. Incase of any exceptions, errors we can send alerts to slack channel or Microsoft teams