Creating a project
After you launch Test Integrations and APIs, you must create a new project, provide a name for your project and save it on your local drive. The following instructions are applicable for the Windows™ OS.
The new project is created.
Importing the Swagger definition of phonebook sample API from Test Virtualization Control Panel
You must add a Swagger file to your project that defines a REST API as an external synchronization source. Therefore, you create a project to run a test in Test Integrations and APIs by importing a Swagger definition of an API.
You must have created a project as described in Creating a project. Your project must be open in Test Integrations and APIs.
You model a system under test against which you run tests. Test Virtualization Control Panel provides some sample APIs that you can use while working with Test Integrations and APIs. You can use one of these sample APIs as the system under test.
You have successfully created the Swagger definition in Test Integrations and APIs. The service components and operations are created in the background.
Creating a test from the Swagger definition of the API
After you import a Swagger definition of an API into Test Integrations and APIs you can create a test and configure the operation and schema for the messages for the test, from the options available in the Swagger definition.
You must have imported the Swagger definition by following the steps in Importing the Swagger definition of phonebook sample API from Test Virtualization Control Panel.
You have configured a test based on the Swagger definition.
You must run the test. See Running the test.
Running the test
You can run the test that you created based on the imported Swagger definition and verify the test result.
You must have created the test following the steps in Creating a test from the Swagger definition of the API.
If any action editor (of the Send Request or Receive Reply action) is open, you must close it.
When your run the test, the test attempts to verify the response it receives from the API against the structure and data values that are contained in the test. Because you created the test by importing a Swagger definition, and Swagger definitions only contain message structure and not the actual data, the test has nothing to verify the response. Hence, the test fails.
You can modify the test based on the response received. See Modifying the test by basing it on the response data.
Modifying the test by basing it on the response data
You must take data values from the response that the test received when you ran the test. You must modify the test to use those values and verify the response received.
You must have run the test by following the steps in Running the test.
The test finishes successfully.
Viewing messages and actions
After running tests successfully, you can view requests and responses messages and their associated actions of send and receive, respectively. You can use the action editor to view the messages at a later time without running the tests again.
You must have run the tests successfully by following the steps in Modifying the test by basing it on the response data.
You can view the messages received by the test and also view the messages that the test sends to the API being tested.
You have viewed the data that was exchanged in the test with the API under test. You can return to this action editor through the test editor in the Test Factory perspective at a later time without having run the test first.
- Open the Test Factory perspective.
- In the tree on the left, right-click the queryPhonebook
operation, and click .
This action creates a new test for the operation and automatically creates request and response actions by using the information of the Message Exchange Pattern of the operation which was imported from the Swagger definition.
You must create stubs (virtual services) that can substitute the dependencies of your system under test. See Creating and running a stub.
To run tests as part of continuous integration or continuous delivery pipeline, see Running tests by using an Ant task.
To make the test more flexible in the number of entries it can receive and what data those entries can contain, you can use repeating elements and data sources. For details, see Repeating elements in messages.

icon.






