- Subscribe to RSS Feed
- Bookmark
- Subscribe
- Email to a Friend
- Printer Friendly Page
- Report Inappropriate Content
Session Template Packages
|
A session template can be created from a message response's selected text using the Session Template wizard from within the Clip Editor. A test clip can also be selected from the Test Clips list and the string to search can then be specified from within the Session Templates wizard. |
|||||||||||||||||||||||||||
|
The Session Template Package wizard can be launched from the Test Clips list by selecting a test clip and then right clicking to select the Launch Session Template Package Wizard command. Existing session templates or packages can be applied here using the Apply a Session Template or Package command. |
|
||||||||||||||||||||||||||
|
The Session Template Package Wizard can also be launched from the Convert Recording to Test Clip wizard, Next Steps page for a newly converted test clip by clicking Go to the Session Template Package Wizard. When you do so, the test clip is first opened in the Clip Editor, and then the wizard launches. |
|
||||||||||||||||||||||||||
|
Once created, both session templates and packages can be viewed from the new Central > Session Templates node. |
|
||||||||||||||||||||||||||
|
Additionally, the Clip Editor now includes a Session Template drop-down button that exposes both these commands, as well as the Launch Session Template Wizard. This third command can be launched with or without a selection in the lower panel of the Clip Editor. |
|
||||||||||||||||||||||||||
|
Creating a Session Template Package Session Template Packages can be created from either the Test Clips list or if the test clip is open, click the Session Templates button.
|
|
||||||||||||||||||||||||||
|
The Session Template Package wizard appears. The Include and Exclude sections are used to define or delimit the scan. By default, most possible nodes in the recorded responses (in the test clip) are included. Note: While this wizard runs, CloudTest maintains a draft of the original test clip. If the template is applied, the original test clip is then renamed with the date/time appended to it and the parameterized clip keeps the original name. |
|
||||||||||||||||||||||||||
Note: Session templates are created for selected XPath or SubString items, but are not created when the extraction method is changed to new script or existing script. |
|
||||||||||||||||||||||||||
Include OptionsChecked items in this section are included in the test clip scan.
Keep this checked to include HTTP headers from the recorded response in the scan of this test clip.
Keep this checked to scan envelope nodes and attributes (SOAP, REST, etc.).
Keep this checked to scan POST data associated with this test clip.
Keep this checked to scan Query String.
Check this box and enter one or more comma-delimited custom delimiters to further delimit the fields POST Data, Query String Params, and Location (and not Entire URL, REST, Envelope, or Headers). For example, if the user enters the following comma-delimited phrase: Then, CloudTest will split the POST Data, Query String Params, and Location on both semi-colon and colon while searching for name/value pairs such as: If the custom delimiter is: Then,
When Location is checked, either or both of the following two options can also be applied.
When including URLs, use the Exclude Names box and entry field on the right to delimit the scan by excluding those fields.
REST parameters are excluded (e.g. unchecked) by default. With REST checked, use the Values box on the right to further delimit a scan for REST parameters. Alternately, check “Use a custom delimiter” to introduce a custom delimiter from a given environment. Exclude OptionsThe exclude names and values specified here are skipped during the scan for every Include type on the left. The following Exclude options are presented:
This option is checked and set to 2 characters by default.
This option is checked and the listed HTTP header names are excluded by default. These options (along with the URLs field) formerly comprised the Show Advanced section.
This option is checked and the listed parameter values are excluded by default. |
|||||||||||||||||||||||||||
The Scan Clip button becomes inactive and the scan begins. After the clip is scanned, the scan button automatically becomes re-enabled if the Include or Exclude options are changed. |
|
||||||||||||||||||||||||||
|
Scan progress is indicated by the green progress bar. Rows begin to appear as the scan progresses. Additionally, the Working icon appears on the right edge of the Progress bar and to the left of the Scan Clip button. |
|
||||||||||||||||||||||||||
|
Once the scan is complete, the green checkmark appears and the table below is populated with name/value pairs. Some rows may appear before the scan completes. Rows whose names have values for suggested replacement are checked. |
|
||||||||||||||||||||||||||
|
The scan results are presented in the following columns:
The wizard assigns this name for use by CloudTest. This name is based on the Property Name found in column 5 and is used to refer to this pair in the session template package and in the Central > Session Templates list.
This value corresponds to the named location or action. For example, the value for a location is a relative URL.
This is the test clip component that contains the message response in which the name/value pair is first found. For example, the pair may be first recorded in an HTTP response.
This is the test clip component in which the name/value pair is first used by the test clip. For example, a location or property that is found in Message2 may not be used until a subsequent message.
The name of the property specified by responses from the target site. This is distinct from the CloudTest-assigned name in column 1 although the value may be the same.
Each row has a Value Retrieval Method and an Edit button. The possible method types are:
|
|
||||||||||||||||||||||||||
Check the box for any row to add it to the package as is, or click its Edit button to make changes via the selected value retrieval method.
Refer to Editing an XPath, Parsing a SubString, Creating a New Script, or Use an Existing Script below for additional instructions for either method. |
|||||||||||||||||||||||||||
|
Note that the Session Template Package Wizard’s Scan Clip function returns results that can be expanded to show all prior messages in the scanned test clip that contain that same value. The user can then select the most relevant value from among those expanded. The original message is displayed as the parent row, with only one level of nesting for all the other messages. |
|
||||||||||||||||||||||||||
|
To expand the row, click its corresponding arrow. Once expanded, the children are all displayed in one level. The expanded row shows the same value selected that was already selected before expansion, in which case that value appears with its radio button selected. This level contains all of the other messages with this value. A radio button is displayed for each possible selection. The child row is where a given value originates. It allows the user to chose to extract not from the first response we find the value in, but from previous responses. |
|
||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
|
When you click Apply, all checked rows are sent to the server. Then, working on the draft of the test clip, the Session Template Package wizard creates clip-level custom properties, and adds the corresponding message-level property paths that utilize them, as well as defining Property Sets. Note: In the Session Templates Package Wizard any Session Templates that use the Existing Script or New Script options will appear with their text in the list with strike-through on it, to indicate that the time will not be saved as one of the Session Templates in the package.
|
|||||||||||||||||||||||||||
Parsing a SubString
If the box doesn't appear, click the Edit button (with SubString selected as the Value Retrieval Method for the row). |
|
||||||||||||||||||||||||||
The SubString Parser box appears. The recorded value is highlighted in orange. If the string is very long the box will scroll right to display as much of it as possible. |
|
||||||||||||||||||||||||||
In the shot on the right the Test Result field shows the __VIEWSTATE value has been successfully extracted.
|
|
Creating a Regular Expression Using the SubString ParserThe SubString Parser provides the unique ability to build regular expressions based on selected text from the message response text shown above. Use the following steps to create a regular expression. Note: In CloudTest, when you are entering a Regular Expression for a Session Template, to Include/Exclude resources in a page, or for a PropSet in the Message Editor portion of the Clip Editor, you are entering a Java regular expression. Whereas, when you use regular expressions within a script (via the RegExp object or the /pattern/ notation), you are using a JavaScript regular expression. The two are not interchangeable, so you can’t copy expressions from one to the other. See Regular Expression Support in CloudTest for more information. The Regular Expression section includes the following fields:
|
|
|
In the example on the right, an
|
|
|
TIP: In cases where variable, or non fixed, text is part of a text string that has been inserted into either the Leading Text or Trailing Text fields, that text can be replaced in the expression below by first selecting it, and then clicking Insert Non-Fixed to the right of the Expression field. For example, if the text string,
|
|
After Insert Non-Fixed was clicked, the Expression field string,
|
Note: If Use Regular Expression is checked at the time the Insert buttons are used, the Expression field is populated at that time.
|
|
|
Editing an XPathAn XPath can be reviewed, revised, and tested using the XPath Editor. XPath values can be manually edited; however, care should be taken when doing so as invalid code will break the test clip.
|
|
|
Creating a New ScriptUse this box to specify parameters for generating a script to replace the specified value. This page does not appear when using other wizard options.
|
|
Use an Existing Script
|
|





























