How to parameterise username and passwords in Cucumber features when using multiple examples | Selenium Forum
S
sowndarya Posted on 24/01/2020

Hi Team,

I am using Cucumber+Selenium+junit for automating test cases. 

My feature files are as below. I pass multiple examples for different environments into the scenario. In my test application the passwords keep on changing every 60days and updating these passwords in every feature file is very cumbersome. Could you please help me how i can parameterize these username and passwords and pass it from seperate config file, so that every time the passwords changes i can update them at a single place.

Scenario Outline: Verify the login functionality in xyz application

Given I open the browser

And I launch the xyz application <url>

When I enter the <username> and <password>

And click on sign in button

Then User should login successfully

Examples

@SIT

|url |username |password|

|sit.com|situser|sitpassword|

 

@UAT

|url |username |password|

|uat.com|uatuser|uatpassword|

 

@Training

|url |username |password|

|training.com|traininguser|trainingpassword|