When viewing a stateless transaction on the Transactions tab, you can see the components that are shown in the following graphic.
E: The Response panel shows the response to the stateless requests.
Note: If you add or change several transactions, click. The magic string and date variables are created for you. Existing magic strings and variables are not modified.
To view and edit transaction data for specific or meta transactions, use the Transaction Basics editor. Select a specific transaction or META from the Transactions list.
The Transaction Basics editor lets you specify the following information:
The Request Data editor allows you to update the data that is associated with a request.
VSE uses the operation name and arguments to look up a matching response for an incoming transaction.
The META transaction is a template for the specific transactions. For more information, see Logical Transactions. Therefore, arguments can be added to and removed from the META transaction, and these changes apply to all specific transactions in that logical group. Arguments cannot be directly added to or removed from specific transactions.
To perform a mass change of request arguments, click Mass Change. The Change Request Arguments dialog appears.
To specify mass changes, complete the fields on the Change Request Arguments dialog as appropriate, and click Update.
To add, edit, move, and delete key/value pairs, use the Attributes tab.
To add, edit, move, and delete Meta data key/value pairs, use the Meta Data tab.
To insert a sample match script for your information, right-click the Match Script panel. You can also switch the match script on or off by selecting or clearing the Do Not Use the Script check box.
To designate the scripting language, use the language drop-down on the lower right of the pane.
To hide or display line numbers, the editor toolbar, and the editor status bar, right-click on the left side of the Match Script panel, then select the appropriate options from the short-cut menu. The following graphic shows all options that are displayed.
A match script defines how VSE decides whether a specific transaction matches the incoming one. To receive a match that is based on the specific condition, write BeanShell scripts performing appropriate actions.
/* always match name=joe */
ParameterList args = incomingRequest.getArguments();
if ("joe".equals(args.get("name"))) return true else return
You do not need to specify a match tolerance level or match operator for the match script to work. The match is found based on the condition in the match script.
By default (with no match script) an inbound request is matched against a service image request by comparing operations, arguments, or both to come to a true/false "Do they match?" answer. A match script simply replaces this logic with whatever logic makes sense and must still come to the true/false "Do they match?" answer.
The script can use the default matching logic. Inside the script, use the expression, "defaultMatcher.matches()". This expression returns a true or false using the VSE default matching logic.
The match script is similar to a scripted assertion. Basically, it is a regular BeanShell script but with the following additional variables preloaded for you (and the usual properties and testExec variable):
Return a Boolean value from the script; true means a match was found.
If there is an error evaluating the script, VSE deliberately ignores the error and defaults to the regular matching logic. If you do not think your script is being run, review the VSE log file.
A good way to add logging and tracing into your match scripts is to embed calls to the VSE matching logger. The VSE matching logger produces the messages in the vse_xxx.log file, where xxx is the service image name. For example:
VSE.info(testExec, "short msg", "a longer message");
VSE.debug(testExec, "", "I got here\!\!");
VSE.error(testExec, "Error\!", "Some unexpected condition");
If you log messages at INFO, later when the production settings are applied to the logging.properties file, the log level is WARN and your messages appear as a DevTest test event (a "Log Message" event).
Tips from logging.properties:
Change INFO to WARN or comment out the following line for production systems:
The Match Script editor toolbar lets you perform the following functions:
Returns you to the last edit that was made
Finds the next occurrence of the selected text
Finds previous occurrence
Finds next occurrence
Toggles the highlight search
Shifts the current line to the left four spaces
Shifts the current line to the right four spaces
Inserts comments slashes (//) at the cursor position
Removes the comments slashes (//)
To view and edit the response information, use the Response Data editor.
Edit the Think Time Spec field as necessary.
To add, edit, move, and delete key/value pairs, use the Meta Data tab.
Tip: You can only add properties if the response is text. You cannot add properties to a binary response.