Adding a Virtual Service to a Test
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 Service Virtualization Use Cases and Capabilities.
In the past, perhaps you worked with a center of excellence or other group to obtain virtual services to cover your specific testing scenario, or you built and managed them yourself using another tool. With Service Virtualization fully integrated into BlazeMeter, it is a much simpler process to associate a virtual service with your test. The test creation page includes a virtual service configuration that lets you quickly see the available virtual services, choose what you need based on your test requirements, and obtain the endpoint for the virtual service.
Add virtual services to tests
The Virtual Services Configuration is available for performance and functional tests.
Follow these steps:
- Access the Configuration tab for a performance or GUI functional test.
- Find the Virtual Services Configuration and click the slider to open it.
- Click the + button and select Add Virtual Service.
- Select a virtual service from the Virtual Service Name drop-down list.
The virtual 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 virtual service might be a virtualization of one part of that service, such as AWS S3. These names are all controlled by the user who created the virtual services.
After you select the virtual service, its information appears on the same row. If the Status is Stopped, the virtual service is not running, and any tests run against that virtual service will fail. Run the virtual service from the Service Virtualization tab to be able to use it in a test.
If the Status is Running, your virtual service is ready, and the endpoint for the virtual service is available.You can add multiple virtual services as needed. When you delete a virtual service from this pane, it only deletes it from that test, not from the product. - (Optional) Select the Template that contains the Transactions and Parameters you want to load into the virtual 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.If you have not selected a template, the virtual service will run with the transactions that it was configured with. - With your selections in place, you should then verify if the application has been configured to test against the virtual service. If not, copy the endpoint and make the necessary change at the application level to ensure that the test runs against the virtual service instead of the live service.
When you run the test, the data from the Template is loaded into the virtual service at runtime, and it overrides any existing Transactions that were defined directly in the virtual service.
If you want to load a virtual service into a test without using a Template, add the virtual service directly in the Taurus script and not in the UI.
Add individual virtual services and tags
Click the Service Virtualization tab to select individual virtual services and to add tags to a single test.
The yaml construct will be updated as the following example: