Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Published by Scroll Versions from space FUNCTDEV and version SVC2023.1

This topic explains how Virtualize groups messages together in the " Generate Parameterized Messages from Traffic " wizard. Virtualize generates a responder for each message, so the groupings are important for determining which responders are generated.  

...

  • Grouping based on Request Body is selected in the following cases:
    • SOAP Traffic
    • Non-XML message formats, including custom message formats
    • Non-HTTP traffic
  • Grouping based on HTTP Method and URL Paths is selected in other cases—except cases, except that HTTP method is only selected if there are variations in the methods within the provided traffic.

...

Split the generated Message Responders based on the HTTP method (POST, GET, PUT, etc.and so on). When this strategy is enabled, each unique HTTP method results in a Message Responder getting generated. 

For example, if the traffic contains 10 POST messages and 15 GET messages (regardless of their order), Virtualize will create 2 two responders in the generated PVA: one for the POST messages and one for the GET messages (assuming that no other grouping strategies have triggered further splits in the groups). 

The resulting groups can be customized so that a group can capture messages of more than one HTTP method. For example, if both POST and PUT are enabled within a group, then messages using the POST method and messages using the PUT method will match the group and get assigned to it. In other words, the responder that is generated based on that group will correlate with both POST and PUT messages (it will accept either one).

...

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

...

  • Responder 1: for the summary paths (3 three messages)
  • Responder 2: the contact path (2 two messages)
  • Responder 3: for the Foo paths (2 two messages)

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 four-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

...

  • Responder 1: the URL parameter oid is present (3 three messages)
  • Responder 2: the URL parameters ssn and state are present (2 two messages)

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.

...

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:

  • Responder 1: category=women (2 two messages)
  • Responder 2: category=babies (1 one message)
  • Responder 3: state=CA, category=silver (1 one message)
  • Responder 4: state=CA, category=gold (1 one message)

Anchor
Grouping Based on Request Body Content
Grouping Based on Request Body Content
Grouping Based on Request Body Content

...

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

...