background image
<< Why Use Blocks | Example of Nested Blocks >>
<< Why Use Blocks | Example of Nested Blocks >>

Adding a Block

Adding Features to Scripts
Adding a Block
To insert a block into a script:
1. If the Session Insert floating toolbar is not already displayed, click the Insert
button on the Session Record floating toolbar.
2. Click the Start Block button at that point in the script where you want the block
to begin--for example, just before you start to record a transaction.
3. Type the block name.
Robot uses this name as the prefix for all command IDs in the block. The
maximum number of characters for a command ID prefix is seven.
4. Click OK.
5. Record all of the client requests in the block.
6. Click the Stop Block button to end the current block and click OK.
When you start and stop a block during recording, the commands are reported as
annotations in the Annotations window.
Nesting Blocks
To nest blocks, click Start Block on the Session Insert floating toolbar to start a new
block without explicitly ending the current block.
When you nest blocks:
Robot automatically starts a timer at or near the beginning of the second block.
Timing continues on the first block (in other words, a stop timer command
not inserted for the first block).
The second block's name replaces the first block's name as the prefix for
emulation commands.
NOTE: When you end a block, you always end the current block. If you are
nesting blocks, you cannot specify which block you want to end--the Stop Block
command always applies to the innermost block. For more information, see
Nesting Blocks on page 8-6.
NOTE: You can add a block during recording only, not during editing.