示例#1
0
        /// <summary>
        /// Returns ICapabilities for Safari with these options included as
        /// capabilities. This copies the options. Further changes will not be
        /// reflected in the returned capabilities.
        /// </summary>
        /// <returns>The ICapabilities for Safari with these options.</returns>
        public override ICapabilities ToCapabilities()
        {
            if (this.isTechnologyPreview)
            {
                this.BrowserName = TechPreviewBrowserNameValue;
            }

            DesiredCapabilities capabilities = this.GenerateDesiredCapabilities(true);

            if (this.enableAutomaticInspection)
            {
                capabilities.SetCapability(EnableAutomaticInspectionSafariOption, true);
            }

            if (this.enableAutomaticProfiling)
            {
                capabilities.SetCapability(EnableAutomticProfilingSafariOption, true);
            }

            foreach (KeyValuePair <string, object> pair in this.additionalCapabilities)
            {
                capabilities.SetCapability(pair.Key, pair.Value);
            }

            return(capabilities.AsReadOnly());
        }
示例#2
0
        /// <summary>
        /// Returns DesiredCapabilities for Edge with these options included as
        /// capabilities. This copies the options. Further changes will not be
        /// reflected in the returned capabilities.
        /// </summary>
        /// <returns>The DesiredCapabilities for Edge with these options.</returns>
        public override ICapabilities ToCapabilities()
        {
            DesiredCapabilities capabilities = this.GenerateDesiredCapabilities(false);

            if (this.useInPrivateBrowsing)
            {
                capabilities.SetCapability(UseInPrivateBrowsingCapability, true);
            }

            if (!string.IsNullOrEmpty(this.startPage))
            {
                capabilities.SetCapability(StartPageCapability, this.startPage);
            }

            if (this.extensionPaths.Count > 0)
            {
                capabilities.SetCapability(ExtensionPathsCapability, this.extensionPaths);
            }

            foreach (KeyValuePair <string, object> pair in this.additionalCapabilities)
            {
                capabilities.SetCapability(pair.Key, pair.Value);
            }

            return(capabilities.AsReadOnly());
        }
示例#3
0
        /// <summary>
        /// Returns ICapabilities for Safari with these options included as
        /// capabilities. This copies the options. Further changes will not be
        /// reflected in the returned capabilities.
        /// </summary>
        /// <returns>The ICapabilities for Safari with these options.</returns>
        public override ICapabilities ToCapabilities()
        {
            DesiredCapabilities capabilities = this.GenerateDesiredCapabilities(false);

            foreach (KeyValuePair <string, object> pair in this.additionalCapabilities)
            {
                capabilities.SetCapability(pair.Key, pair.Value);
            }

            return(capabilities.AsReadOnly());
        }
示例#4
0
        /// <summary>
        /// Returns DesiredCapabilities for Opera with these options included as
        /// capabilities. This does not copy the options. Further changes will be
        /// reflected in the returned capabilities.
        /// </summary>
        /// <returns>The DesiredCapabilities for Opera with these options.</returns>
        public override ICapabilities ToCapabilities()
        {
            Dictionary <string, object> operaOptions = this.BuildOperaOptionsDictionary();

            DesiredCapabilities capabilities = this.GenerateDesiredCapabilities(false);

            capabilities.SetCapability(OperaOptions.Capability, operaOptions);

            foreach (KeyValuePair <string, object> pair in this.additionalCapabilities)
            {
                capabilities.SetCapability(pair.Key, pair.Value);
            }

            return(capabilities.AsReadOnly());
        }
示例#5
0
        /// <summary>
        /// Returns DesiredCapabilities for IE with these options included as
        /// capabilities. This copies the options. Further changes will not be
        /// reflected in the returned capabilities.
        /// </summary>
        /// <returns>The DesiredCapabilities for IE with these options.</returns>
        public override ICapabilities ToCapabilities()
        {
            DesiredCapabilities capabilities = this.GenerateDesiredCapabilities(true);

            Dictionary <string, object> internetExplorerOptions = this.BuildInternetExplorerOptionsDictionary();

            capabilities.SetCapability(InternetExplorerOptions.Capability, internetExplorerOptions);

            foreach (KeyValuePair <string, object> pair in this.additionalCapabilities)
            {
                capabilities.SetCapability(pair.Key, pair.Value);
            }

            return(capabilities.AsReadOnly());
        }
示例#6
0
        /// <summary>
        /// Returns DesiredCapabilities for Firefox with these options included as
        /// capabilities. This does not copy the options. Further changes will be
        /// reflected in the returned capabilities.
        /// </summary>
        /// <returns>The DesiredCapabilities for Firefox with these options.</returns>
        public override ICapabilities ToCapabilities()
        {
            DesiredCapabilities capabilities = GenerateDesiredCapabilities(this.isMarionette);

            if (this.isMarionette)
            {
                Dictionary <string, object> firefoxOptions = this.GenerateFirefoxOptionsDictionary();
                capabilities.SetCapability(FirefoxOptionsCapability, firefoxOptions);
            }
            else
            {
                if (this.profile != null)
                {
                    if (this.Proxy != null)
                    {
                        this.profile.InternalSetProxyPreferences(this.Proxy);
                    }

                    capabilities.SetCapability(FirefoxProfileCapability, this.profile.ToBase64String());
                }

                if (!string.IsNullOrEmpty(this.browserBinaryLocation))
                {
                    capabilities.SetCapability(FirefoxBinaryCapability, this.browserBinaryLocation);
                }
                else
                {
                    using (FirefoxBinary executablePathBinary = new FirefoxBinary())
                    {
                        string executablePath = executablePathBinary.BinaryExecutable.ExecutablePath;
                        capabilities.SetCapability(FirefoxBinaryCapability, executablePath);
                    }
                }
            }

            foreach (KeyValuePair <string, object> pair in this.additionalCapabilities)
            {
                capabilities.SetCapability(pair.Key, pair.Value);
            }

            return(capabilities.AsReadOnly());
        }
示例#7
0
        /// <summary>
        /// Returns DesiredCapabilities for Chrome with these options included as
        /// capabilities. This does not copy the options. Further changes will be
        /// reflected in the returned capabilities.
        /// </summary>
        /// <returns>The DesiredCapabilities for Chrome with these options.</returns>
        public override ICapabilities ToCapabilities()
        {
            Dictionary <string, object> chromeOptions = this.BuildChromeOptionsDictionary();

            DesiredCapabilities capabilities = this.GenerateDesiredCapabilities(false);

            capabilities.SetCapability(ChromeOptions.Capability, chromeOptions);

            Dictionary <string, object> loggingPreferences = this.GenerateLoggingPreferencesDictionary();

            if (loggingPreferences != null)
            {
                capabilities.SetCapability(CapabilityType.LoggingPreferences, loggingPreferences);
            }

            foreach (KeyValuePair <string, object> pair in this.additionalCapabilities)
            {
                capabilities.SetCapability(pair.Key, pair.Value);
            }

            return(capabilities.AsReadOnly());
        }