The Tests tab for each operation in your model lets you create a range a comprehensive set of positive, negative, and edge case API tests that thoroughly test the selected operation. Once the tests are created, you can execute them and review the results of each test. The tests are executed like any other functional tests in BlazeMeter.
Note: You can also generate tests for all of the operations in your model at one time by clicking Generate All Tests in the left panel. You can then execute the tests from the Tests tab for each operation.
- Create an API Model or edit an existing one to access the Edit API Tests page.
- Click a resource in the left pane to view the operations under that resource.
- Click an operation name to view the details for that operation in the right side of the page.
- Make any desired changes to your API model.
- Click the Tests tab.
The Tests tab opens. If you previously generated test cases for this operation, you can review the existing tests.
- Review any existing test cases and determine whether you need to generate a new set of tests.
- To generate a new set of tests, click Generate Tests in the Auto Generated section of the tab.
Note: Clicking Generate Tests removes all existing auto generated tests before creating a new set of tests.
- Click Execute Tests.
Note: Clicking Execute Tests executes all the tests that are defined for this operation, regardless of whether the check box is selected or not. The check box is only used for removing tests.
Once your tests are executed, the View Report button appears.
- Click View Report to see the results of your API tests.
The results for the selected tests open in a new browser tab. If you click View Reports before the execution is complete, a status bar shows you the progress of your test execution.
Note: Your test results are also available from the Reports menu in BlazeMeter. For more information about viewing your reports, see the Understanding Reports section under Tests & Reports in this knowledge base.
- To remove one or more tests, select the check box for each test that you want to remove and click Remove Tests.
Once your API tests are created, it is also possible to run them using the BlazeMeter REST API. This means that instead of manually starting the tests, you can create an automated script that runs a predefined test via the API. For more information, see the API Overview and related articles.