Changing test generation preferences
You can change the way that the test recorder organizes multiple send and receive elements in a new socket test by changing test generation preferences. To improve the readability of your test, you can merge consecutive send or receive elements that use the same connection.
Before you begin
To change the way that test elements are organized by default in a new test, you can change the test generation preferences before recording the test.
To merge or reorganize elements in an existing test, you can use the Organize wizard. See Merging socket send and receive elements for more information.
Procedure
- Click .The Socket Test Generation preferences window opens.
- Select Strategies.You can create multiple organization strategies for handling different applications. Only one strategy is active during the recording.
- Select Default Strategy or click New to create an organization strategy.
- Click Settings.
- In Edit Socket Strategy Settings, specify how you want the test recorder to generate multiple send
and receive elements:
- 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 Rational® Performance Tester 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.
- Click OK to apply the changes, and close the Preferences window.