Individual session templates can be created by selection from within the Clip Editor. Using this method, a session template is created from selected text in a message request or response in the Clip Editor lower panel.
Creating a New Session Template from a Selection
- From Central > Test Clips, open the test clip that contains the value to parameterize.
- Locate and then open the message that contains the value to parameterize.
TIP For large test clips, switch to List mode using the Clip Editor toolbar, and then use the drop-down number count to increase the messages in display, or use the arrow buttons to navigate to the given message if it occurs later than message 50. If you’re not sure where the field occurs, use Find and Replace from the Test Clips list (right click) to locate the message.
In a Message, a highlighted text string in a request (in the URL Values, in the Query String, or in the Data) or in the response in the Clip Editor can be made into a session template’s value.
Note: If the value is known, the Session Template wizard can be launched without first selecting a value. Use the Values field on the first wizard page to enter the value and proceed at Step 5.
- Select the text on which to create this template.
- Once you have selected text, click the Session Templates drop-down on the toolbar and then select Launch Session Template Wizard.
The Value Search and Retrieval page appears. If text was selected it is displayed in the Value field.
- In the Value Search and Retrieval page, click Find to locate the clip component(s) in which the string occurs.
For the example selection, Use Substring is selected. The results are listed in Recorded Responses, while the selected component’s details are posted in Response Content with the selected string highlighted in orange. If there is more than one result, use Next to move through the series.
The example wpLoginToken value was found in Mesage58, which is listed in the Recorded Responses list.
Note that the Recorded Response value is where the selected value was first defined in the session as a response from the target site.
- Optionally, click Edit to access the SubString Parser dialog box in cases where additional configuration is necessary. Refer to Parsing a SubString for more about this dialog box.
- Optionally, click either Use this XPath or Use an existing script to parameterize this value instead of Use SubString.
- Click Use this XPath to enter an XPath for the given value. With this option, specify the XPath by entering or pasting it into this field.
- Click Use an existing script to select from the scripts already in place. Locate and select the script and then click OK.
- Optionally, click Use a new script to specify parameters for generating a script to replace the selection at runtime and then click the right green arrow to proceed to the New Script and Value Location Definition page.
Use this page to create a new script to replace the dynamic value at runtime. This page does not appear when using other wizard options.
- Give the new script a name.
- Check Save as a linked script to insert this script into the test clip. A linked script will be inserted after the relevant test clip component(s), which must have local scope. Uncheck the Save as a link script box to save the script without adding it to this test clip.
- Response content from the prior step is shown with a default parameter selected.
- Select text in the Response Content field and then click Insert Selected for any of the following: Leading Text, Trailing Text, Value Length or End of Text.
- Click Generate Script to generate the script. The script code is posted to the script field based on the selection(s). If alternate values were selected above after Generate Script was clicked, click the button a second time.
- After setting values and/or defining a new script, click the right green arrow to proceed to the next step. The Custom Property Definition page appears. Use this page to name a new or to select an existing clip-level custom property that will then be used to perform extraction and insertion (at runtime) of this value.
- Click the right green arrow to proceed. The Session Template Find page appears.
- Click Find All. The clip component(s) in which the selected value is found are posted in results. In the example below only one value is found, in Message65, but in other cases there may be additional occurrences.
- Check the box for each item to include or click the top box to include all.
- Click the right green arrow to proceed.
- The Summary page appears. Assign the session template a name, and optionally, enter a description and selected a folder for it.
Note: Name, Description, and Save Location appear here only if New Script or Existing Script options were NOT used exclusively. For either script option, the session template cannot be re-applied, and so save options do not appear in cases where only scripts are used.
The Summary page also displays the retrieval value method, property name, type, and owner, as well as the search and replacement values. and folder for all affected test clip components, with the exception of script options.
- Click OK to complete the wizard accepting the wizard options, or Cancel to abandon these changes.