Created
November 16, 2019 15:54
-
-
Save issam1975/bf85cf4a20cfeb427f48d9b79963b1a8 to your computer and use it in GitHub Desktop.
selenium profile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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