Currently Browsing

Posts Tagged ‘ webtesting ’

Cucumber in Web testing (part 8 of 8)

8. Keyword “Examples” and conclusion

 

Gherkin keyword: Examples

Cucumber provides another useful Gherkin keyword which is used scenario parametrization. A scenario with an “Example” keyword will be executed multiple times with different parameters. Here is an instance:

@init @logout
  Scenario Outline: Successful Login with Valid Credentials
    Given User is on Home Page
    When User Navigate to LogIn Page
    And User enters username "<userName>"
    And User enters password "<password>"
    And Click login
    Then Message displayed Login Successfully

 
Examples:
| userName | password |
| username1 | password 1 |
| invalid | invalid |