Setting and Using Message Scope

CloudTest provides the ability to set scope on objects in the repository that will define whether an item is private, public, or local.

By default, a message's scope is 'private' (as shown on the right) and its response cannot be accessed by another item in the composition, such as a script. Using private scope as a default permits CloudTest to throw away the response as soon as it's received in order to save memory.

  • Private means the item’s information cannot be accessed from the outside

  • Local means that an item’s information can be accessed only by other items within the same parent container

    For example, making a Message local means that the Message can only be accessed by other items within the same Clip

  • Public means the item’s information can be accessed from anywhere.

Messages can have individual scope regardless of whether they are included in collections, such as the page shown on the right.

In cases where a message response needs to be accessed, its scope can be set to 'public' or 'local' (depending on its location) in order to make its response information available for access. For any parent item in the path, its scope must also be set for access.

For example, if a script needs the response info from a message in the same test clip, set the message to local. However, if a script that needs the response info is in a different test clip than the message, then the message must have scope “public” along with the test clip containing the message. Any other parent objects, such as pages or groups, that the script must go through must also have public or local scope, depending upon where the script is in relation to the message. In the screenshot on the right, a message, search.jsp, has been set to local scope. Since it's in a group, the group is also set to local. With these settings, search.jsp can be modified by scripts within the test clip.