public static IWebDriver CreateWebDriver(BrowserOptions options)
        {
            IWebDriver driver;

            switch (options.BrowserType)
            {
            case BrowserType.Chrome:
                var chromeService = ChromeDriverService.CreateDefaultService(options.DriversPath);
                chromeService.HideCommandPromptWindow = options.HideDiagnosticWindow;
                //var chromeOptions = options.ToChrome();
                //chromeOptions.BinaryLocation = "";
                //driver = new ChromeDriver(chromeService, chromeOptions);
                driver = new ChromeDriver(chromeService, options.ToChrome());
                break;

            case BrowserType.Firefox:
                var ffService = FirefoxDriverService.CreateDefaultService(options.DriversPath);
                ffService.HideCommandPromptWindow = options.HideDiagnosticWindow;
                driver = new FirefoxDriver(ffService);
                driver.Manage().Timeouts().ImplicitWait = new TimeSpan(0, 0, 5);
                break;

            case BrowserType.Edge:
                var edgeService = EdgeDriverService.CreateDefaultService(options.DriversPath);
                edgeService.HideCommandPromptWindow = options.HideDiagnosticWindow;
                driver = new EdgeDriver(edgeService, options.ToEdge(), TimeSpan.FromMinutes(20));

                break;

            default:
                throw new InvalidOperationException(
                          $"The browser type '{options.BrowserType}' is not recognized.");
            }

            driver.Manage().Timeouts().PageLoad = options.PageLoadTimeout;

            if (options.StartMaximized && options.BrowserType != BrowserType.Chrome) //Handle Chrome in the Browser Options
            {
                driver.Manage().Window.Maximize();
            }

            if (options.FireEvents || options.EnableRecording)
            {
                // Wrap the newly created driver.
                driver = new EventFiringWebDriver(driver);
            }

            return(driver);
        }
        public InteractiveBrowser(BrowserOptions options)
        {
            this.Options = options;

            Trace = new TraceSource(this.Options.TraceSource);
        }