Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
using NUnit.Framework;
using OpenQA.Selenium;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using TechTalk.SpecFlow;
using TechTalk.SpecFlow.Assist;
namespace SpecflowParallelTest.Steps
public class LoginSteps
private IWebDriver _driver;
public LoginSteps(IWebDriver driver)
_driver = driver;
[Given(@"I navigate to application")]
public void GivenINavigateToApplication()
[Given(@"I enter username and password")]
public void GivenIEnterUsernameAndPassword(Table table)
dynamic data = table.CreateDynamicInstance();
[Given(@"I click login")]
public void GivenIClickLogin()
[Then(@"I should see user logged in to the application")]
public void ThenIShouldSeeUserLoggedInToTheApplication()
var element = _driver.FindElement(By.XPath("//h1[contains(text(),'Execute Automation Selenium')]"));
Assert.Multiple(() =>
Assert.That(element.Text, Is.Null, "Header text not found !!!");
Assert.That(element.Text, Is.Not.Null, "Header text not found !!!");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment