Procedure with arguments

If you want to create arguments for your procedures, following the steps below:

1 In the procedure header, click on the procedure that you want to have an argument – in this case the procedure Simpel Demo that we want to change and therefore need to transfer the time of delay as an argument.

2 Click on the tab Parameters in the properties window.

3 Click on Add.

Creating of a parameter.

4 Type a suitable name in the field Name – for example the word Time.

5 Select a suitable data type in the field Data Type – in this case we select the data type TimeSpan that is suitable for time units.

6 Click on OK.

7 Now click on line 2 in the procedure– Delay for 5000 milliseconds.

8 Mark Delay Time specified by expression in the tab General in the properties window. Type the name of your argument, in this case Time, in the expression editor.

The argument name should be types in the expression editor,

After this, we need to indicate the argument value in connection with the actual call.

9 Click on line 1 in your main program – Call Demo.Simpel Demo and hereafter on the tab Parameters in the properties window.

You could also delete the procedure call and recreate it – but there is also another way.

To do this, we first need to synchronise the arguments so that single procedures are aware of the arguments belonging to other procedures.

10 Click on the tab Errors and Warnings, and hereafter on the control Synchronise Parameters.

The tab Errors and Warnings contains an overview of the errors which are relevant in your test definition right now, for more on this see chapter 4 Step-by-Step.

If you are not able to view this tab, you can have it displayed by selecting the command View ( Errors and Warnings

11 Click on line 1 in your main program – Call Demo.Simpel Demo, and hereafter on the tab Parameters in the properties window.

The tab Parameters in the properties window.

You are now able to view the argument Time, and now all we have to do is to give it a value.

12 Double-click on the argument Time in the tab Parameters.

13 Type the value 2500 in the field Value, and click on OK.

You can view your transfer of arguments in the tab Execution Log.

14 Double-click the procedure header for your main program to execute the procedure where the delay time is set as an argument.

You have now tried to create procedures and make transfers of arguments with the main purpose of getting to know the user interface.

In the next chapter we will go through some of the procedure steps in SeqZap so that you can get an impression of how these are used in a script file.