- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What do you mean by Scenario Outline in Cucumber?
We use the Scenario Outline keyword in the feature file in Cucumber. If a particular scenario needs to be executed with more than a set of data in multiple combinations, then we use the Scenario Outline.
The multiple data sets are represented in form of a table separated by (||) symbol under Examples keyword. Each row represents a group of data.
Example
Feature file.
Feature: Login Verification Feature Scenario Outline: Login Verification Given User lands on the home page When Page title is Tutorialspoint Then User keys in "<username>" and "<password>" Examples: | username | password | | Selenium | t123 | | Python |pt123 |
Step Definition file with Then statement having parametrization.
Example
@Then (“^User keys in \"(.*)\” and \"(.*)\”$”) public void user_keys(String username, String password){ System.out.println("The username and password is : " + username +””+ password); }
Advertisements