I need help please, I have a working Selenium Webdriver/Gherkin/Specflow project that I created.
I am trying to migrate my code to another environment (stage), but I only want to make changes in the app.config to switch between the different environments. I have successfully executed the URL switch with app.config using the 'Switch Cases', the problem I am facing now is how to create second login and how will gherkin knows to switch to the specific environment that I am running?
Currently I have my username and password store in gherkin like this:
Examples:
| firstname | username | password |
| Cam | Newton | 12345dev |
This is how I am performing my url switch:
switch (environment)
{
case "DEV":
if (!(_driver.Url.Equals(Constants.DEV_LandingPage)))
{
_driver.Navigate().GoToUrl(Constants.DEV_LandingPage);
}
break;
case "STAGE":
if (!(_driver.Url.Equals(Constants.STAGE_LandingPage)))
{
_driver.Navigate().GoToUrl(Constants.STAGE_LandingPage);
}
break;
}