Multi-Part HTTP Messages

Document created by Chris Sommerstad Employee on Jul 21, 2017
Version 1Show Document
  • View in full screen mode

CloudTest supports multi-part HTTP POST messages such as those commonly used in HTTP forms that specify the POST method. CloudTest will capture any such message automatically as part of recording and create the multi-part message during clip conversion.

  • To view a multi-part POST captured during the recording process, open the given recording in the Recording Editor and select it. The relevant content appears in the Request Body section on the lower left of the editor. The Request Body indicates that the selection has “Multi-Part Content”.

Optionally, click the Request Body’s Maximize icon to expand the view (as shown below) of the read-only message parts.

In addition to being captured as a part of recording, Multi-part POST messages can also be created manually by checking the Multi-part post box in the Message Editor. This box is checked by default for multi-part messages created from recordings.

Working with Automatically Created Multi-Part Messages

Multi-part POST messages appear in the Clip Editor workspace just as do any messages.

  1. Locate and then double-click a selected POST message to open it in the Message Editor lower panel.

  1. Once open in the lower panel, a multi-part message is indicated by the checked Multi-part POST checkbox in the Message Editor, Inputs, Data field.
  2. Optionally, click the Message Editor’s Recorded Request, Request Content node to view the read-only message parts. For message parts that have images, they are shown.

  1. For each message part, a Headers and Body section is presented. The message part is bounded by a gray border with a Plus and Delete icon just above the message part (top right). Both sections are editable. Scroll down in the editor to examine the constituent parts of the multi-part message.

  1. For a selected Header section, a blue border appears indicating the field is editable. The Property Chooser icon appears on the right. Perform property substitutions as in prior releases by clicking the Properties icon and selecting from among existing custom, system, or global properties, or by defining a new property.

  1. For a Body section, a blue border appears indicating the field is editable. The (inactive, in this case) Base Encoding and Property Chooser icons appear on the right of the field.

  1. If the field is base encoded, then the Base Encoding icon appears active (as shown below). Click the Base Encoding icon to toggle it on or off.

  1. Each section also has an associated File upload interface for file upload selection (either by clicking Browse or by clicking within the Choose a file to upload for the data field). Use Upload binary data for non-text and Upload text for text files.
  • When a binary file is chosen and Upload binary data is clicked, the file is encoded and the relevant code is posted in the Body field with the Encoding icon toggled on.

  • When a text file is chosen and Upload text data is clicked, the file contents are displayed in the Body field.

Longer messages are concatenated with the total bytes and bytes shown stated. Click the hyperlink to view the full contents of a given message part.

  1. Add additional message parts by clicking the green Plus icon. Delete existing message parts by clicking the red Delete icon. Note that the final message of a multi-part message cannot be deleted and an error message will display if such an attempt is made.

To delete the entire clip element, select it in the Clip Editor workspace above and then click Delete on the Clip Editor toolbar. If the message is placed in the HTML Document segment of a page, it will be necessary to delete the page itself.

  1. Save the clip after making any changes.

Creating a New Multi-Part POST Message

Multi-part messages can be constructed on the fly using the Clip Editor, either from an existing POST message, or by adding a new POST message using an Included Target.

  1. Open the clip to edit in the Clip Editor or click the New Clip icon to create a new clip.
  2. Determine whether to use an existing POST message or to create a new POST message.
    • To add parts to an existing POST message, select and double-click it in the Clip Editor workspace.
    • To add a new POST message, click the Clip Editor’s Messages/Actions tab, and then select (or add) an Included Target on which the POST message will be based. Once the message is added to the clip, select and double-click it to open it in the lower panel Message Editor.
    • In the Message Editor, select the Inputs, Data node, and then check the Multi-part post box.

When you do so, CloudTest converts the message to multi-part and then populates the HTTP Request Headers section for multi-part use and the paired Headers/Body sections are added.

Note that for an existing message the prior content of the message is placed into the Body field of the new section.

  1. For an existing message, define the appropriate headers. For a new manually created message, define the Headers/Body pair with their respective values.

  1. To add more pairs to this multi-part message, click the green Plus icon on the top right just above where the new part will be placed. When you do so, a new section with blank Headers and Body is placed below.
  2. Repeat the steps to define Headers/Body for the new message part.
  3. Click the green Plus icon once for each required pair and then define those values according to need. Note that text values can be pasted into place.
    • To perform a property substitution, click in the Body field and then click the Properties icon.
    • If this value must be Base64 encoded, toggle the Encoding icon so it’s active.
  4. Save the clip after making any changes.

Multi-Part Messages in Result Details

  1. To view multi-part messages in the Result Details widget, use either the Navigation Tree on the left or the Cover Flow above to navigate to the relevant message.

  1. Once selected, with the default Input/Output tab selected in the widget, inspect the multi-part message request in the middle pane. Use the horizontal and vertical scrollbars to navigate within the Request pane.

  1. Click the Events List tab to inspect the event details for the selection.