When adding parameters to groups, you can make it much more general and reusable.

You can add parameters to groups the exact same way you add parameters to custom JavaScript steps.

Let's go over a common scenario, where we want to create a login group which accepts a username and password parameters, and then set its value to the corresponding input fields.

Record the steps

First, we'll record simple flow of login:

  1. Set username.
  2. Set password.
  3. Click "Login".

4. Select the login steps and group them together to a "Login" group.

5. Select the "Login" group we created, and open its Properties panel
6. Add 2 new JS params (JavaScript Parameters)

Name the parameters and set their values:

  • username - set the values to 'demo_user'
  • password - set the value to '12345'

Note:  When placing a constant value in the parameter value field use ' ' around it.

Great, so now we have a group that gets two parameters (username and password). Now we need to set its inner steps to use those values.

The JavaScript parameters on the group are available to all its child steps simply by using their names. 

  1. Step into the group, by double-clicking the group. 
  2. Select the 'Set "User Name"' step. 
  3. Change the value in the Properties panel from the current static value to the new group parameter:username

Now we'll do the same for the 'Set "Password"' step:

That's it!
 We have a login group with parameters, that can be easily reused with a different set of values without the need to change the group itself.

Did this answer your question?