Socket Test Generation preferences
With the socket test generation preferences, you can change how the test recorder generates new socket tests.
- Filters
- Select connections in this list to be excluded from the generated test. Click Add Application to filter connections from a specific program. Click Add Host to filter connections to a specific host.
- Strategies
- Select a change strategy or click New to add a change strategy. Click Settings to open the Socket Strategy Settings editor.
Socket Strategy Settings Editor
Use this editor to define rules for merging and handling large numbers of send and receive elements in a socket test.
- Send elements
- Merge consecutive send elements
- Select this option to merge together all the consecutive socket send elements that use the same connection.
- Manipulate data with custom code
- Select this option to force all the selected send elements to enable the Manipulate data with custom code setting with the specified Class name of a custom Java™ class that uses the API to process data in the socket send element.
- Receive Actions
- Do not merge
- Select this option to keep receive elements unmodified as they are initially recorded.
- Merge consecutive receive elements
- Select this option to merge together all the consecutive socket receive elements that use the same connection.
- Keep only last receive element
- Select this option to discard all multiple consecutive receive elements except the last one recorded.
- Response timeout
- The maximum delay (in seconds) to receive the first byte of the response. If no data is received before the end of the response timeout delay, the receive action produces an error in the test log. The response timeout counter starts when the receive action starts after the think time; the counter is interrupted when the first byte is received.
- End policy
- This option specifies when to stop receiving data and to move
to the next test element.
- Receives exact number of bytes: The receive action stops when the recorded number of bytes is received. Specify a Timeout (in seconds) after which the receive action produces an error in the test log, if the correct number of bytes is not received. If Link data size is enabled, the receive action expects the number of bytes displayed in the Data area. If Link data size is disabled, the receive action expects the number of bytes displayed in Bytes. This is the default setting
- Receives until end of stream: The receive action stops when the connection is closed by the remote computer. If Accepts empty response is selected, then the reception of a single byte is not required and the Response Timeout is ignored. Specify a Timeout (in seconds) after which the receive action produces an error in the test log, if the correct number of bytes is not received.
- Matches a string: The receive action stops when a specified sequence of bytes is received. Specify a Timeout (in seconds) after which the receive action produces an error in the test log, if the correct number of bytes is not received.
- Recognizes a regular expression: The receive action stops when a sequence of bytes that matches a regular expression is received. Specify a Timeout (in seconds) after which the receive action produces an error in the test log, if the correct number of bytes is not received.
- Delegated to custom code: The receive action stops when a condition is met in a custom Java™ class. This setting allows great flexibility, but requires coding of a custom Java™ class following the HCL OneTest™ Performance extension API. Click Generate Code to generate a template based on the API or View Code to open the specified class in the Java™ editor.
Except when the Receives until end of stream policy is in force, receive actions produce an error in the test log when the connection is closed by the remote computer.
- Timeout
- For end policies that have a Timeout setting, this setting specifies a delay (in seconds) after which the receive action produces an error in the test log if the end policy criteria is not met. The timeout counter starts when the first byte is received.