Exemplo n.º 1
0
        private void StartFireFox(SettingsCollection settings)
        {
            FirefoxOptions options = new FirefoxOptions();

            if (settings.GetBooleanSetting("debugEnabled"))
            {
                if (!settings.GetBooleanSetting("browserVisible"))
                {
                    options.AddArgument("-headless");
                }
            }
            else
            {
                options.AddArgument("-headless");
            }

            FirefoxDriverService service = FirefoxDriverService.CreateDefaultService();

            service.HideCommandPromptWindow = true;
            Driver = new FirefoxDriver(service, options);
            Driver.Manage().Window.Maximize();
        }
Exemplo n.º 2
0
        private void StartChrome(SettingsCollection settings)
        {
            ChromeOptions options = new ChromeOptions();

            if (settings.GetBooleanSetting("debugEnabled"))
            {
                if (!settings.GetBooleanSetting("browserVisible"))
                {
                    options.AddArgument("--start-fullscreen");
                    options.AddArgument("headless");
                }
            }
            else
            {
                options.AddArgument("--start-fullscreen");
                options.AddArgument("headless");
            }
            options.AddArgument("--start-maximized");
            ChromeDriverService service = ChromeDriverService.CreateDefaultService();

            service.HideCommandPromptWindow = true;
            Driver = new ChromeDriver(service, options);
        }