Group Command Management


Create a group command

Navigate to Hiring sample -> Create Position Request CSHS -> Case1 to generate a group command.

  1. Import hiring sample project.

  2. Enter project dashboard.

  3. Click Create Position Request CSHS in left-side menu bar.

  4. Click Case1

  5. Click Edit button on the right of suite name.

  6. Choose at least two continuous case steps to save as group command.

  7. Click Save as Group Command button.

  8. Fill group command name and description in the form.

    Notes The scope field has two options, the private means the command can be used only in current project, the public means the command can be used in other projects. By default the value is private.

  9. Click Save button.

    Then Group Command and New Group Command you have created will appear in the left-side menu bar, and the case steps you have chosen are folded in the new group command.

  10. Click Exit Edit button.

Notes
You can also add group command through the custom command menu.

Add group command

You can add a group command when you want to add some steps which belongs to this group command.

  1. Click Edit button on the right of suite name.

  2. Click button in the operation column of case step list table where you want to reuse a group command.

  3. Fill add case step form according to below table.

    Parameter Description
    Command Reused group command name, in custom category
    Assignee Workflow user who help you finish process
    comment Comment of command

  4. Click Add button.

  5. Click Exit Edit button.

Edit group command

Edit group command name and description

  1. Click Group Command in left-side menu bar.

  2. Click button on the right of group command name.

  3. Edit group command name and group command description.

  4. Click Update button.

Edit case steps of group command

  1. Click Execute Custom.command_name with parameters {{Parameters}} in case step list or click command name in left-side menu bar.

  2. Edit case steps.

Delete Group command

  1. Remove the command from test cases first.

    • Enter into case step list of every test case which includes the group command.
    • Right click on the row of group command, it shows the context menu.
    • Click Delete to delete it.
    • Click Exit Edit button.

  2. Click button on the right of group command name.

Define Group parameter

  1. Define the group parameter for the group command.

    • Click Group Command in left-side menu bar.
    • Click Parameter button on the top right of group command page.
    • Enter group parameter key,display name in the group parameter page.
    • Click Add button to add group parameter.
    • Click Cancel button to exit.

  2. Bind group parameter for case step parameter.

    • Click Edit button to edit case step.
    • Choose the parameter value from the select box.
    • Click Save button to save the parameter.

  3. Edit this group command parameter value in the case step. You can see name is defined in the group parameter will be acted as the parameter input for group command.

Add IF Command to a group command

In some scenarios, IDA Users want to execute a group command only when it meets some conditions. Now, IDA supports to add an IF Command to a group comand, and the group command will be executed if the IF Command result is TRUE. The IF Command is a custom javascript command. Let’s go through it step by step:

1. Create a custom javascript command named ‘Custom Condition’.

Please refer to How to create a custom javascript command?

Notes: The command will read the value of ‘Hiring manager’ and ‘Number of employees’ on the html page. If the value of ‘Hiring manager’ equals ‘Tom’ and the value of ‘Number of employees’ euqals 12, then IDA executes the group command named ‘GroupWithCondition’, or else, it will skip the group command. The content of the command is as below:

    //TODO Add your JavaScript implementation here
    var hiringManagerCoachView = bta.util.getCoachViewByLabel("Hiring manager", null);
    var hiringManageValue;
    if (hiringManagerCoachView.context.binding) {
      hiringManageValue = hiringManagerCoachView.context.binding.get("value");
    }
    var employeeNumCoachView = bta.util.getCoachViewByLabel("Number of employees", null);
    var employeeNumValue;
    if (employeeNumCoachView.context.binding) {
      employeeNumValue = employeeNumCoachView.context.binding.get("value");
    }

    //A IF command must return bta.util.setIFCommandResult(flag)
    //If the parameter is true, execute the attached group command, else the parameter is false, skip the attached group command.
    var isExecuteGroupCommand = (hiringManageValue == "Tom" && employeeNumValue == 12);
    return bta.util.setIFCommandResult(isExecuteGroupCommand);

Here is the sample html page:

2. Right click the group command and click Edit, Users could add a IF Command to a group command from the modal.

Use a Group Command in Other Test Projects within a Team

If a group command is created in a test project with a specific team scope, then this group command can be used in any test projects created by or accessible to a team member.

1. Add the group command in a test project with a specific team scope visibility.

2. In other test projects created by a team member or visible to the team member within a team, the team member can find and use the group command.

See also Team Configuration.

Categories:

Updated: