Esempio n. 1
0
        public static FirefoxDriver CreateFirefoxDriver(LocalWebBrowserFactory factory)
        {
            if (!string.IsNullOrWhiteSpace(pathToFirefoxBinary))
            {
                return(CreateAlternativeInstance());
            }

            try
            {
                return(new FirefoxDriver(GetFirefoxProfile()));
            }
            catch
            {
                factory.LogInfo("Default location of firefox was not found.");

                var env = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles);
                if (env.Contains("(x86)"))
                {
                    env = env.Replace("(x86)", "").Trim();
                }
                var firefox = "Mozilla Firefox\\Firefox.exe";
                if (File.Exists(Path.Combine(env, firefox)))
                {
                    return(CreateAlternativeInstance(env, firefox));
                }

                env = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86);
                if (File.Exists(Path.Combine(env, firefox)))
                {
                    return(CreateAlternativeInstance(env, firefox));
                }
                throw;
            }
        }
Esempio n. 2
0
        public static EdgeDriver CreateEdgeDriver(LocalWebBrowserFactory factory)
        {
            var options = new EdgeOptions()
            {
            };

            return(new EdgeDriver(options));
        }
Esempio n. 3
0
        public static InternetExplorerDriver CreateInternetExplorerDriver(LocalWebBrowserFactory factory)
        {
            var options = new InternetExplorerOptions
            {
                BrowserCommandLineArguments = "-private"
            };

            return(new InternetExplorerDriver(options));
        }
Esempio n. 4
0
        public static ChromeDriver CreateChromeDriver(LocalWebBrowserFactory factory)
        {
            var options = new ChromeOptions();

            options.AddArgument("test-type");
            options.AddArgument("disable-popup-blocking");

            options.AddArguments(factory.Capabilities);

            if (factory.GetBooleanOption("disableExtensions"))
            {
                options.AddArgument("--disable-extensions");
            }

            return(new ChromeDriver(options));
        }
Esempio n. 5
0
 public ChromeDevWebBrowser(LocalWebBrowserFactory factory) : base(factory)
 {
 }
 public FirefoxFastWebBrowser(LocalWebBrowserFactory factory) : base(factory)
 {
 }
 public InternetExplorerFastWebBrowser(LocalWebBrowserFactory factory) : base(factory)
 {
 }