How to launch Firefox with default profile using selenium 3.13.1 and C#
I am new to Selenium and after exhaustive research I can't find a reliable example to launch Firefox with my default profile so I retain my extensions, bookmarks etc. Much has changed and the examples I find are now deprecated or use Java syntax. Here's my set up:
- Windows 7 - Visual Studio 2017 Community - C# - Selenium WebDriver 3.13.1 - Selenium WebDriver Support 3.13.1 - geckodriver 0.21.0 - Firefox v. 61.0.1
References have been set on the solution. Here is my code:
FirefoxProfileManager myProfileManager = new FirefoxProfileManager(); FirefoxOptions options = new FirefoxOptions(); options.Profile = myProfileManager.GetProfile(@"C:\\Users\\Robert\\AppData\\Roaming\\Mozilla\\Firefox\\Profiles\\4halwx5j.default");;
IWebDriver driver = new FirefoxDriver(); WebDriverWait wait = new WebDriverWait(driver, TimeSpan.FromSeconds(10));
driver.Url = "https://lastpass.com/?ac=1&lpnorefresh=1"; driver.Manage().Window.Maximize();
Would anyone be so kind to provide an example that works using WebDriver 3.13.1 FF v. 61.0.1and C# syntax? Thanks in advance for your help!