Forum Discussion

TestCoeUs1337's avatar
TestCoeUs1337
Occasional Contributor
11 months ago

Parametrising just one step while using BDD does not work for me

Hello everyone, my issue is: 

Im trying to run tests using BDD and javascript
I got a step 

Then <user> is present in the results:
      | user        |
      | User1     |
      | User2     |



I manage to do this for scenario outline but now I want to achieve this for a single step... what am I doing wrong? 

  • rraghvani's avatar
    rraghvani
    10 months ago

    See Gherkin Syntax in TestComplete, you need to use the keyword Examples.

    For example,

    Scenario Outline: Check discounts
      Given The list of orders is clear
      And I select Edit > New Order from the main menu
      And The New Order form is visible
      When I enter <Count> in the Quantity text box
      Then The Discount label should display the <Percent> value
    
      Examples:
      | Count | Percent |
      | 10    |  7      |
      | 20    |  10     |
      | 30    |  15     |
  • TestCoeUs1337's avatar
    TestCoeUs1337
    Occasional Contributor

    The coresponding code works with just 1 value, however when I try to run this step multiple times using the table I am unable to, I feel like Im missing something very simple..

    • rraghvani's avatar
      rraghvani
      Champion Level 3

      See Gherkin Syntax in TestComplete, you need to use the keyword Examples.

      For example,

      Scenario Outline: Check discounts
        Given The list of orders is clear
        And I select Edit > New Order from the main menu
        And The New Order form is visible
        When I enter <Count> in the Quantity text box
        Then The Discount label should display the <Percent> value
      
        Examples:
        | Count | Percent |
        | 10    |  7      |
        | 20    |  10     |
        | 30    |  15     |
      • TestCoeUs1337's avatar
        TestCoeUs1337
        Occasional Contributor

        Actually used data tables but thanks for your answer anyway!