private static ExtensionConnection CreateExtensionConnection(FirefoxBinary binary, FirefoxProfile profile, TimeSpan commandTimeout) { FirefoxProfile profileToUse = profile; string suggestedProfile = Environment.GetEnvironmentVariable("webdriver.firefox.profile"); if (profileToUse == null && suggestedProfile != null) { profileToUse = new FirefoxProfileManager().GetProfile(suggestedProfile); } else if (profileToUse == null) { profileToUse = new FirefoxProfile(); } ExtensionConnection extension = new ExtensionConnection(binary, profileToUse, "localhost", commandTimeout); return extension; }