Skip to content

Instantly share code, notes, and snippets.

@issam1975
Created November 16, 2019 15:54
Show Gist options
  • Save issam1975/bf85cf4a20cfeb427f48d9b79963b1a8 to your computer and use it in GitHub Desktop.
Save issam1975/bf85cf4a20cfeb427f48d9b79963b1a8 to your computer and use it in GitHub Desktop.
selenium profile
FirefoxProfileManager profileManager = new FirefoxProfileManager();
FirefoxProfile profile = profileManager.GetProfile("default-release");
var driverpath = AppDomain.CurrentDomain.BaseDirectory;
profile.SetPreference("browser.startup.homepage", "abcd");
profile.SetPreference("startup.homepage_welcome_url", "abcd");
var ffoptions = new FirefoxOptions();
ffoptions.AddArgument("--no-sandbox");
ffoptions.Profile = profile;
using (FirefoxDriver driver = new FirefoxDriver(FirefoxDriverService.CreateDefaultService(driverpath), ffoptions, TimeSpan.FromSeconds(240)))
{
driver.Quit();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment