Creating multiple tests by using MEP
You can create multiple tests from a Message Exchange Pattern (MEP) in Test Integrations and APIs from the Test Factory view. An operations MEP defines the pattern, schema, and binding for messages that are exchanged by the operation. You can create multiple tests that adhere to the rules defined in the MEP.
Before you begin
- Defined a service component and an operation under a service component. See Creating a service component and Creating an operation.
- Edited the operation for the MEP settings. See Editing an operation.
- Opened the project in the Test Factory view.
About this task
You can create multiple tests in an operation that use the message exchange pattern (MEP) either at the time of synchronizing resources or after you have created and bound the physical resource with the logical one in an operation.
When you create tests you can opt to alter the occurrences of some of the message elements in the Structural Configuration dialog or opt to change the value of the element type in the Contents Configuration dialog.
You can create different tests for each of the content configuration or the variable test data that you set by selecting the Fixed option.
- A single data-driven test with multiple content iterations is created along with the test data in an Excel worksheet that specifies the values for the iterations which is used at test run time.
- Multiple data-driven tests with different test structures and content iterations along with the test data in different files that are used by each of the tests during test run time.
- The data-driven tests are created under the Tests folder in the selected operation.
- A dataset that contains the test data for all the test iterations for each of the data-driven test is created under the Test Data folder in the selected operation.
- Both the test and the test data are created with the same name and subsequent data-driven tests that are generated in the same operation are suffixed with a number that increases for each successive generation.
- The physical files of the test and the test data reside in the operation folder of the
service component folder of the logical folder in your project directory.
For example, the location can be as: D:\Projects\Mytest\Logical\HotelFinder.wsc\getHotels.opr\, where HotelFinder.wsc is the name of the service component and getHotels.opr is the name of the operation.
- When you delete the generated test or the generated dataset in the UI, the corresponding physical file is not deleted from their physical location.
Procedure
- Select the operation or folder in which you want to create the tests.
-
Perform any of the following actions:
- Right-click the operation or folder and select from the menu.
- Click the arrow next to the Test icon in the Test Factory toolbar and select Tests.
Note: If you created a test already, you can right-click the Tests folder or one of the existing tests, and then select .The Binding Configuration dialog is displayed, if the operation that contains the tests has a WSDL as its parent. -
Select the binding properties for the request and reply messages, and then click
Next.
The Structural Configuration dialog is displayed.
-
Perform the following actions in the Structural Configuration dialog
box:
-
Perform the following actions in the Contents Configuration dialog
box:
-
Select your action based on the options available in the With Tests
panel as described in the following table:
Option Description Do Nothing Creates the tests as displayed in the Statistics panel. Note: This is the default option.Add to suite Adds the generated tests to an existing test suite that you select by clicking Browse, and then selecting the existing test suite. Create new suite Adds the generated tests to a new test suite, which you must name in the Suite field. Note: This option is enabled only if there are more than one test to be generated. If a single test is to be generated, you can only add it to an existing test suite and cannot create a new test suite.Run suite on Finish Runs the new or existing test suite when the MEP wizard closes. Note: This option is enabled if you select either the Add to suite or Create new suite option.At the end overwrite the expected messages... Overwrites the expected messages with the messages that are received when the tests are run. Note: This option is enabled if all of the following conditions are satisfied:- You selected the Fixed option to generate the tests.
- Alternatively, you selected the Data Driven option and you are able to create multiple data-driven tests with different structural tests, and then opt to add the generated tests to a new test suite.
- You selected the Run suite on Finish option.
- You must have configured a database as the Results Database in the Project Settings of your project, and the database is accessible at test run time.
- Click Finish to create the tests and return to the Test Factory main view.