Feature: LogIn_Feature
In order to access my account
As a user of the website
I want to log into the website
@mytag
Scenario: Successful Login with Valid Credentials
Given User is at the Home Page
And Navigate to LogIn Page
When User enter UserName and Password
And Click on the LogIn button
Then Successful LogIN message should display
Scenario: Successful LogOut
When User LogOut from the Application
Then Successful LogOut message should display
NuGet Selenium.WebDriver ( 3.12.1 )
Create Steps Folder
Generate Definitions File in the Steps Folder
NUnit3 Test Runner
Build the project to ensure available tests show up in the runner
Selenium WebDriver NuGet
Search for Selenium.WebDriver & Install
download geckodriver & place in project root
placing the webdriver here requires an absolute reference to it when instantiating it
IWebDriver driver = new FirefoxDriver("C:\\path\\to\\driver");
There are other locations that will work fine, but given there is coupling between the Selenium & webdriver versions, this will require some sort of management strategy
even better would be to place the webdrivers in folders with the version name such as
/project/res/webdriver/0.21/geckodriver.exe
Create a simple method to test the webdriver setup is functioning
IWebDriver driver = new FirefoxDriver("C:\\path\\to\\driver");
driver.Url = "http://www.unityconstruct.org";
driver.close();
using OpenQA.Selenium;
using OpenQA.Selenium.Firefox;
using TechTalk.SpecFlow;
namespace SpecFlowDemo
{
[Binding]
public class LogIn_FeatureSteps
{
IWebDriver driver;
[Given(@"User is at the Home Page")]
public void GivenUserIsAtTheHomePage()
{
driver = new FirefoxDriver("C:\\Users\\silosix\\source\\repos\\CEssentials2018\\SpecFlowDemo");
driver.Manage().Timeouts().ImplicitWait = System.TimeSpan.FromSeconds(15);
driver.Url = "http://www.unityconstruct.org/uc";
Assert.True(driver.Title == "Home | UnityConstruct");
}