public UrlBuilder(WebsiteConfig config)
        {
            protocol   = config.Protocol;
            hostName   = config.HostName;
            port       = config.Port;
            securePort = config.SecurePort;
            path       = config.Folder;
            //Use the first IPv4 address that we find
            IPAddress ipAddress = IPAddress.Parse("127.0.0.1");

            foreach (IPAddress ip in Dns.GetHostEntry(hostName).AddressList)
            {
                if (ip.AddressFamily == AddressFamily.InterNetwork)
                {
                    ipAddress = ip;
                    break;
                }
            }
            alternateHostName = ipAddress.ToString();
        }
        private EnvironmentManager()
        {
            string          currentDirectory = this.CurrentDirectory;
            string          content          = File.ReadAllText(Path.Combine(currentDirectory, "appconfig.json"));
            TestEnvironment env = JsonConvert.DeserializeObject <TestEnvironment>(content);

            string        activeDriverConfig    = TestContext.Parameters.Get("ActiveDriverConfig", env.ActiveDriverConfig);
            string        activeWebsiteConfig   = TestContext.Parameters.Get("ActiveWebsiteConfig", env.ActiveWebsiteConfig);
            string        driverServiceLocation = TestContext.Parameters.Get("DriverServiceLocation", env.DriverServiceLocation);
            DriverConfig  driverConfig          = env.DriverConfigs[activeDriverConfig];
            WebsiteConfig websiteConfig         = env.WebSiteConfigs[activeWebsiteConfig];

            this.driverFactory = new DriverFactory(driverServiceLocation);

            Assembly driverAssembly = Assembly.Load(driverConfig.AssemblyName);

            driverType         = driverAssembly.GetType(driverConfig.DriverTypeName);
            browser            = driverConfig.BrowserValue;
            remoteCapabilities = driverConfig.RemoteCapabilities;

            urlBuilder = new UrlBuilder(websiteConfig);

            //DirectoryInfo info = new DirectoryInfo(currentDirectory);
            //while (info != info.Root && string.Compare(info.Name, "buck-out", StringComparison.OrdinalIgnoreCase) != 0 && string.Compare(info.Name, "build", StringComparison.OrdinalIgnoreCase) != 0)
            //{
            //    info = info.Parent;
            //}

            //info = info.Parent;
            //webServer = new TestWebServer(info.FullName);
            //bool autoStartRemoteServer = false;
            //if (browser == Browser.Remote)
            //{
            //    autoStartRemoteServer = driverConfig.AutoStartRemoteServer;
            //}

            //remoteServer = new RemoteSeleniumServer(info.FullName, autoStartRemoteServer);
        }