Exemplo n.º 1
0
        private void SetupDriverOptions(BrowserType browser, DriverOptions options, LogLevel logLevel)
        {
            switch (browser)
            {
            case BrowserType.Chrome:
                if (options != null && options is ChromeOptions)
                {
                    _chromeOpts = options as ChromeOptions;
                }
                _chromeOpts.SetLoggingPreference(LogType.Browser, logLevel);
                break;

            case BrowserType.Edge:
                if (options != null && options is EdgeOptions)
                {
                    _edgeOpts = options as EdgeOptions;
                }
                _edgeOpts.SetLoggingPreference(LogType.Browser, logLevel);
                break;

            case BrowserType.Firefox:
                if (options != null && options is FirefoxOptions)
                {
                    _firefoxOpts = options as FirefoxOptions;
                }
                _firefoxOpts.SetLoggingPreference(LogType.Browser, logLevel);
                break;

            case BrowserType.IE:
                if (options != null && options is InternetExplorerOptions)
                {
                    _ieOpts = options as InternetExplorerOptions;
                }
                _ieOpts.SetLoggingPreference(LogType.Browser, logLevel);
                break;

            case BrowserType.Phantomjs:
                if (options != null && options is PhantomJSOptions)
                {
                    _phantomJsOpts = options as PhantomJSOptions;
                }
                _phantomJsOpts.SetLoggingPreference(LogType.Browser, logLevel);
                break;

            case BrowserType.Safari:
                if (options != null && options is SafariOptions)
                {
                    _safariOpts = options as SafariOptions;
                }
                _safariOpts.SetLoggingPreference(LogType.Browser, logLevel);
                break;
            }
        }