示例#1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="SeleniumNodeOptions"/> class.
        /// </summary>
        public SeleniumNodeOptions()
        {
            var helper = new SeleniumServerStandAloneManager();

            if (!helper.HasLocalStandaloneJarFile())
            {
                helper.InstallVersion();
            }

            Capabilities = new[]
            {
                new Dictionary <string, string>
                {
                    { CapabilityType.BrowserName, "chrome" },
                    { "maxInstances", "5" },
                    { "seleniumProtocol", "WebDriver" }
                },
                new Dictionary <string, string>
                {
                    { CapabilityType.BrowserName, "firefox" },
                    { "maxInstances", "5" },
                    { "seleniumProtocol", "WebDriver" },
                    { "marionette", "true" }
                },
                new Dictionary <string, string>
                {
                    { CapabilityType.BrowserName, "internet_explorer" },
                    { CapabilityType.Platform, "WINDOWS" },
                    { "maxInstances", "5" },
                    { "seleniumProtocol", "WebDriver" }
                },
                new Dictionary <string, string>
                {
                    { CapabilityType.BrowserName, "edge" },
                    { CapabilityType.Platform, "WINDOWS" },
                    { "maxInstances", "5" },
                    { "seleniumProtocol", "WebDriver" }
                },
                new Dictionary <string, string>
                {
                    { CapabilityType.BrowserName, "safari" },
                    { CapabilityType.Platform, "mac" },
                    { "technologyPreview", "false" },
                    { "maxInstances", "5" },
                    { "seleniumProtocol", "WebDriver" }
                }
            };
            Hub         = "http://127.0.0.1:4444/grid/register";
            JarFileName = helper.GetLocalFileNameOfVersion();
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="SeleniumHubOptions"/> class.
        /// </summary>
        public SeleniumHubOptions()
        {
            var helper = new SeleniumServerStandAloneManager();

            if (!helper.HasLocalStandaloneJarFile())
            {
                helper.InstallVersion();
            }

            AlwaysCreateHub             = false;
            JarFileName                 = helper.GetLocalFileNameOfVersion();
            PortNumber                  = null;
            UseLocalHubIfAlreadyRunning = true;
            Servlets = new[] { "org.openqa.grid.web.servlet.LifecycleServlet" };
        }