Create Scenario Manually

Applies to TestComplete 14.0, last modified on January 23, 2019

In TestComplete, you can create BDD scenarios by writing their Gherkin code in the TestComplete Gherkin editor.

1. Create project items

In TestComplete, BDD scenarios are located in Feature files that are child items of the Scenarios project item:

Feature files in a TestComplete project

Click the image to enlarge it.

You start creating scenarios by adding these items to your project.

  1. Add the Scenarios project item to your TestComplete project. To do this:

    • Right-click your project in the Project Explorer and select Add > New Item from the context menu.

    • In the subsequent dialog, select Scenarios and click OK:

      Click the image to enlarge it.

      If the Project Explorer panel is hidden, select View > Project Explorer from the main menu to make it visible.

  2. Add a Feature item to Scenarios:

    • Right-click the Scenarios node in the Project Explorer and select Add > New Item from the context menu.

    • In the subsequent dialog, select the Feature type, specify a name and click OK:

      Add a new Feature project item

      Click the image to enlarge it.

      TestComplete will add the new Feature item to the project and will open its editor.

2. Write Gherkin code

After you create a Feature project item, you can create scenarios. You write them in the Gherkin language in the editor of the Feature item:

Generate step definitions

Click the image to enlarge it.

For information on keywords and syntax, see Gherkin Syntax in TestComplete.

3. Automate test steps

After the scenario is ready, automate it, that is, create script code that will simulate the needed user actions.

  1. To start faster, right-click somewhere within the Gherkin editor and select Generate Step Definitions from the context menu, or click this item on the editor toolbar:

    Generate step definitions

    Click the image to enlarge it.

    This will command TestComplete to generate script functions for test steps (Given, When, Then, And, But). The generated code also has statements that link the generated functions to test steps.

  2. Record or write manually script code for the generated functions. See Create Test Step Scripts.

See Also

Create BDD Scenarios

Highlight search results