As a tester, you may need to configure your tests to:
- Test functionality, like negative scenarios or other uncommon behavior, that is difficult to reproduce using the live service
- Test against a service that might not be available
- For other use cases, see Mock Services Use Cases and Capabilities
In the past, perhaps you worked with a center of excellence or other group to obtain mocks to cover your specific testing scenario, or you built and managed them yourself using another tool. Today, with Mock Services functionality fully integrated into BlazeMeter, it's a much simpler process to associate a Mock Service with your test. The test creation page now includes a Mock Services panel that lets you quickly see the available Mock Services, choose what you need based on your test requirements, and obtain the endpoint for the Mock Service.
The Mock Services panel is available for performance and functional tests.
- Access the Configuration tab for a new or existing performance or GUI functional test.
- Find the Mock Services panel, and click the slider to open it.
- Click Add to add a Mock Service to your test.
- Select a Mock Service from the Mock Service Name menu.
The Mock Services are categorized by Service. Services represent the underlying live service. For example, for testing AWS integration in your application, the Service name might be AWS Service, and the Mock Service might be a mock of one part of that service, such as AWS S3. These names are all controlled by the user who created the Mock Services.
After you select the Mock Service, its information appears on the same row. If the Status is Stopped, the Mock Service is not running, and any tests run against that Mock Service will fail. Run the Mock Service from the Mock Services tab to be able to use it in a test.
If the Status is Running, your Mock Service is ready, and the endpoint for the Mock Service is available.
Note: You can add multiple Mock Services as needed. When you delete a Mock Service from this panel, it only deletes it from that test, not from the product.
- Select the Template that contains the Transactions and Parameters you want to load into the Mock Service.
Templates offer common groupings of Transactions. For example, a Template could contain the Transactions required to test key negative scenarios for the AWS S3 service.
- With your selections in place, you should then verify whether the application has been configured to test against the Mock Service. If it hasn't, copy the endpoint and make the necessary change at the application level to ensure that the test runs against the Mock Service instead of the live service.
When the run the test, the data from the Template is loaded into the Mock Service at runtime, and it overrides any existing Transactions that were directly in the Mock Service.
If you want to load a Mock Service into a test without using a Template, add the Mock Service directly in the Taurus script and not in the UI.