public void SetUp()
        {
            if (WebDriver != null) return;

            if ("firefox".Equals(_browser))
            {
                SetWebDriverToFirefox();
            }
            else if ("ie".Equals(_browser) || "internetexplorer".Equals(_browser))
            {
                if (_platform.Contains("win") || "xp".Equals(_platform) || "vista".Equals(_platform))
                {
                    if (_is64bitOS)
                        _iedriverserver = _iedriverserver + "_x64";
                    else
                        _iedriverserver = _iedriverserver + "_Win32";
                }
                else
                {
                    Trace("Assigned browser {" + _browser + "} is not supported on " + _platform);
                    var err = new WebDriverException();
                    //err.Should().BeAssignableTo<WebDriverException>();
                    TearDown();
                }

                SetWebDriverToIE();
            }
            else if ("htmlunit".Equals(_browser))
            {
                LaunchSeleniumStandaloneServer();
                SetWebDriverToHtmlUnit();
            }
            else
            {
                if ("mac".Equals(_platform))
                {
                    _chromedriver = _chromedriver + "_mac";
                }
                else if ("linux".Equals(_platform) || "unix".Equals(_platform))
                {
                    if (_is64bitOS == false)
                        _chromedriver = _chromedriver + "_linux32";
                    else
                        _chromedriver = _chromedriver + "_linux64";
                }
                else
                {
                    _chromedriver = _chromedriver + "_win";
                }

                SetWebDriverToChrome();
            }

            if (!"htmlunit".Equals(_browser))
                WebDriver.Manage().Window.Maximize();

            WebDriver.Manage().Timeouts().ImplicitlyWait(TimeToWait);
            Trace("Web driver {" + _browser + "} successfully started...");
            ScenarioContext.Current.SetWebDriver(WebDriver);
        }
        public void SetUp()
        {
            if (WebDriver != null) return;

            if (_browser.Equals("firefox"))
            {
                SetWebDriverToFirefox();
            }
            else if (_browser.Equals("ie"))
            {
                if (GetCurrentPlatform().Equals("Windows"))
                {
                    if (_is64BitOS)
                        _ieDriverServer = _ieDriverServer + "_x64";
                    else
                        _ieDriverServer = _ieDriverServer + "_Win32";
                }
                else
                {
                    Trace("Assigned browser {" + _browser + "} is not supported on " + _platform);
                    var err = new WebDriverException();
                    err.Should().BeAssignableTo<WebDriverException>();
                    TearDown();
                }
                SetWebDriverToIE();
            }
            else if (_browser.Equals("chrome"))
            {
                if (GetCurrentPlatform().Equals("Mac"))
                {
                    _chromedriver = _chromedriver + "_mac";
                }
                else if (GetCurrentPlatform().Equals("Linux"))
                {
                    if (!_is64BitOS)
                        _chromedriver = _chromedriver + "_linux32";
                    else
                        _chromedriver = _chromedriver + "_linux64";
                }
                else
                {
                    _chromedriver = _chromedriver + "_win";
                }

                SetWebDriverToChrome();
            }
            else if (_browser.Equals("safari"))
            {
                SetWebDriverToSafari();
            }
            else
            {
                if (GetCurrentPlatform().Equals("Mac"))
                {
                    _phantomjs = _phantomjs + "_mac";
                }
                else if (GetCurrentPlatform().Equals("Windows"))
                {
                    _phantomjs = _phantomjs + "_win";
                }
                else if (GetCurrentPlatform().Equals("Linux"))
                {
                    if (!_is64BitOS)
                        _phantomjs = _phantomjs + "_linux32";
                    else
                        _phantomjs = _phantomjs + "_linux64";
                }
                SetWebDriverToPhantomJs();
            }

            if (WebDriver != null)
            {
                WebDriver.Manage().Window.Maximize();
                WebDriver.Manage().Timeouts().ImplicitlyWait(TimeToWait);
            }

            Trace("Web driver {" + _browser + "} successfully started...");
            ScenarioContext.Current.SetWebDriver(WebDriver);
        }