Skip to content

Instantly share code, notes, and snippets.

@cromwellryan
Created March 7, 2012 02:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cromwellryan/1990462 to your computer and use it in GitHub Desktop.
Save cromwellryan/1990462 to your computer and use it in GitHub Desktop.
using System;
using OpenQA.Selenium;
using OpenQA.Selenium.IE;
using OpenQA.Selenium.Internal;
namespace AtddDotNetSpecs.StepDefinitions
{
public class DriverFactory
{
static InternetExplorerDriver currentWebDriver;
public static IWebDriver Driver
{
get { return GetCurrentFireFox(); }
}
public static IFindsByCssSelector CssSelector
{
get { return GetCurrentFireFox(); }
}
public static IHasInputDevices InputDevices
{
get { return GetCurrentFireFox(); }
}
private static InternetExplorerDriver GetCurrentFireFox()
{
return currentWebDriver ?? CreateNewInternetExplorerDriver();
}
private static InternetExplorerDriver CreateNewInternetExplorerDriver()
{
Console.WriteLine("Creating new firefox driver");
return (currentWebDriver = new InternetExplorerDriver());
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment