This topic explains how Virtualize groups messages together in the "Generate Parameterized Messages from Traffic" wizard. The way that messages are groups determines what responders are generated (one responder is generated for each message group)Virtualize generates a responder for each message, so the groupings are important for determining which responders are generated.
Sections include:
Table of Contents | ||
---|---|---|
|
Understanding Grouping
The way that Virtualize groups messages by operation/type is influenced by both a) Virtualize’s Virtualize's analysis of the given traffic and b) the grouping criteria that you choose to apply affect how Virtualize groups messages. Recommended grouping strategies are automatically selected; these recommendations can be adjusted and overridden as you see fit. , but you can adjust and override them as necessary.
Traffic is analyzed and processed Virtualize takes the approach of analyzing the traffic in two stages: first it recommends what
- First, Virtualize recommends which grouping strategies should be enabled
...
- .
- Next, Virtualize applies the selected strategies to divide the messages into groups.
When creating PVAs, one responder is generated for each group.
...
For example, if the traffic contains the following HTTP URL paths (omitting HTTP methods, URL parameters and other factors for brevity)
Code Block |
---|
/service/order/v1/1/summary /service/order/v1/2/summary /service/order/v1/2/summary /service/customer/v1/a/contact /service/customer/v1/b/contact /Foo /Foo |
Virtualize will create three responders in the generated PVA:
...
Note that these responders will be generated using Ant-style wildcards, where * matches zero or more characters and ** matches zero or more directories. See URL Paths Grouping Configuration for details and examples.
...
Virtualize configures URL path segment indexes when creating a new PVA so that each group (responder) can respond to the same requests with varying URL Path values. It configures URL path parameters by providing a segment index. For example, given the following URLs
Code Block |
---|
/rest/api/2/version/1234/relatedIssueCounts /rest/api/2/version/4568/relatedIssueCounts /rest/api/2/version/4567/relatedIssueCounts |
...
Virtualize will designate the fifth path segment (the one with the 4 digit number) to be parameterized with a data source. Response data for each of these IDs can then be data-driven without the need to edit the PVA.
...
For example, if the traffic contains the following URL parameters
Code Block |
---|
?oid=1&category=women ?oid=2&category=women ?oid=1&category=babies ?ssn=1234567890&state=CA&category=silver ?ssn=1234567891&state=CA&category=gold |
...
Virtualize will split the responders in the generated PVA based on the presence of oid, ssn and state parameters as follows (each responder to have the following responder correlation criteria)
...
Note that this heuristic does not NOT generate groups based on URL parameter values. If you want to group based on URL parameter values, you can configure this manually. The grouping based on the presence of URL parameters is configured using the Correlate only when the list of parameters matches exactly and Correlate whenever the parameter name is present regardless of value options. See URL Parameters Grouping Configuration for details.
Anchor | ||||
---|---|---|---|---|
|
...
For example, if the traffic contains the following URL parameters
Code Block |
---|
?oid=1&category=women ?oid=2&category=women ?oid=1&category=babies ?ssn=1234567890&state=CA&category=silver ?ssn=1234567891&state=CA&category=gold |
Virtualize will split the responders in the generated PVA based on the following responder correlation criteria:
...
For example, given the following messages in the traffic file
Code Block |
---|
GET /service/order/v1/1/summary?oid=1&category=women GET /service/order/v1/2/summary?oid=1&category=women GET /service/order/v1/2/summary?oid=1&category=babies POST /service/customer/v1/a/contact?ssn=1234567890&state=CA&category=silver POST /service/customer/v1/b/contact?ssn=1234567891&state=CA&category=gold POST /Foo POST /Foo |
...
Virtualize will group them into responders based on the following criteria for each responder/group:
Group/Responder | HTTP Methods | URL Paths | URL Parameter Presence | Request Body Content |
---|---|---|---|---|
1 | GET | summary | oid | |
2 | POST | contact | ssn, state | |
3 | POST | Foo | child 1 of Body = myOperation |