Configure messages mapping
WebSocket messages mapping is configured with regular or XPath expressions. An identifier is extracted from the request and the response regular or XPath expressions to map the request and the response. Regular or XPath expressions can be specified on each framework.
- Warning: A framework can define only one way to extract the mapping ID from the requests, and one way to extract the mapping ID from the response, so the XPath or regular expression has to be generic enough to handle all requests and all responses.
During post-recording, NeoLoad can automatically search for WebSocket messages mapping in the recorded User Path, and pre-configure it. If the request identifier matches the response identifier, then the couple WebSocket request/response is merged into a single asynchronous action, like a plain HTTP request action.
- Advanced: If several requests mapping IDs match several responses mapping IDs, then the first response is linked to the first request (first-in first-out). For example, if NeoLoad detects sequentially request1, request2, response1, response2 as asynchronous calls with the same mapping ID, then request1/response1 are coupled, and request2/response2 are coupled. This will create two WebSocket asynchronous actions.
To access the Edit Messages mapping screen, in the Frameworks settings section, select a Framework, enable the WebSocket checkbox and click on the wrench-like button.
- Request ID extraction: Defines how the mapping ID is extracted from the request.
- XPath expression (optional): The XPath expression option allows restricting the content extraction to one subsection within the request. XPath can only be used for HTML or XML (HTML, XML, SOAP, GWT, AMF, RTMP, Oracle Forms, Java Serialization and Siebel) -type request.
- Regular expression: Where the request contains text that corresponds to the regular expression definition, that text is extracted. The regular expression is applied to the request or to a subpart of the request extracted by the XPath expression where specified.
- Value template: The template used to assemble the value. This is an arbitrary string with specific elements that refer to the groups within the regular expression (a group is a dynamic part of the regular expression contained within parentheses): $0$ refers to the entire text matching the expression, $1$ refers to group n°1, $2$ refers to group n°2, and so on.
- Response ID extraction: Defines how the mapping ID is extracted from the response.
- XPath expression (optional): The XPath expression option allows restricting the content extraction to one subsection within the response. XPath can only be used for HTML or XML (HTML, XML, SOAP, GWT, AMF, RTMP, Oracle Forms, Java Serialization and Siebel) -type responses.
- Regular expression: Where the response contains text that corresponds to the regular expression definition, that text is extracted. The regular expression is applied to the response or to a subpart of the response extracted by the XPath expression where specified.
- Value template: The template used to assemble the value. This is an arbitrary string with specific elements that refer to the groups within the regular expression (a group is a dynamic part of the regular expression contained within parentheses): $0$ refers to the entire text matching the expression, $1$ refers to group n°1, $2$ refers to group n°2, and so on.
Home