How to use "Type Text" action to type curly brackets that it is included in a text

Problem

In my scenario/script, I have a type text action that includes curly brackets ({}) in the text string. However, when I play the script, the curly brackets are not included in the text string that is typed.

Cause

ScenarioBuilder uses curly brackets (braces) to ignore variable declarations in "Type Text" action. For example if you want to type the following text:

%some text%

ScenarioBuilder will look for the variable "some text" value and type it. However, if you type:

Screenshot_16

ScenarioBuilder will type: %some text%

This behavior is useful in some URLs where multiple percent-signs are required in a URL text.

Solutions

When you need to type curly brackets in an action's property (i.e “Text” property in a "Type Text" action), you can try one of the following solutions:

Solution 1 : Type double brackets

For example, you can have the following text:

Screenshot_18-1

ScenarioBuilder will treat it as: {test}

Note: Make sure that no variables are being typed inside the curly brackets since they will be treated as a plain text.

Curly brackets not included in _Type Text_ action (115001939994)_curlybrackets6

Solution 2 : Declare two variables in your scenario to hold the brackets characters

Add two "Set A Variable" actions to the top of your scenario:

Define a variable: l_cb = {

Curly brackets not included in _Type Text_ action (115001939994)_curlybrackets1

Curly brackets not included in _Type Text_ action (115001939994)_curlybrackets2

Define another variable: r_cb = }

Curly brackets not included in _Type Text_ action (115001939994)_curlybrackets3

Curly brackets not included in _Type Text_ action (115001939994)_curlybrackets4

Then, you will need to replace the curly brackets in your "Type Text" action with the appropriate variable.

For example, if you want to type the text {test}, here is what the text in your action should be:

%l_cb%test%r_cb%

Curly brackets not included in _Type Text_ action (115001939994)_curlybrackets8

Solution 3 : Type a single curly bracket at a time

Instead of adding one "Type Text" action, you can have three actions:

  • One that prints the opening curly brackets
  • A second one that has the text you want to be inside the brackets
  • A third action to type the closing curly bracket.
Curly brackets not included in _Type Text_ action (115001939994)_curlybrackets9