Skip to content

Instantly share code, notes, and snippets.

@executeautomation
Created September 18, 2016 02:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save executeautomation/23512f1f8f392832ab31b690484d1375 to your computer and use it in GitHub Desktop.
Save executeautomation/23512f1f8f392832ab31b690484d1375 to your computer and use it in GitHub Desktop.
using BoDi;
using OpenQA.Selenium;
using OpenQA.Selenium.Firefox;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TechTalk.SpecFlow;
namespace SpecflowParallelTest
{
[Binding]
public class Hooks
{
private readonly IObjectContainer _objectContainer;
private IWebDriver _driver;
public Hooks(IObjectContainer objectContainer)
{
_objectContainer = objectContainer;
}
[BeforeScenario]
public void Initialize()
{
_driver = new FirefoxDriver();
_objectContainer.RegisterInstanceAs<IWebDriver>(_driver);
}
[AfterScenario]
public void CleanUp()
{
_driver.Quit();
}
}
}
@executeautomation
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment