ToCapabilities() public method

Returns DesiredCapabilities for IE with these options included as capabilities. This copies the options. Further changes will not be reflected in the returned capabilities.
public ToCapabilities ( ) : ICapabilities
return ICapabilities
        private static ICapabilities ConvertOptionsToCapabilities(InternetExplorerOptions options)
        {
            if (options == null)
            {
                throw new ArgumentNullException("options", "options must not be null");
            }

            return(options.ToCapabilities());
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="InternetExplorerDriver"/> class using the specified
 /// <see cref="DriverService"/>, <see cref="InternetExplorerOptions"/>, and command timeout.
 /// </summary>
 /// <param name="service">The <see cref="InternetExplorerDriverService"/> to use.</param>
 /// <param name="options">The <see cref="InternetExplorerOptions"/> used to initialize the driver.</param>
 /// <param name="commandTimeout">The maximum amount of time to wait for each command.</param>
 public InternetExplorerDriver(InternetExplorerDriverService service, InternetExplorerOptions options, TimeSpan commandTimeout)
     : base(new DriverServiceCommandExecutor(service, commandTimeout), options.ToCapabilities())
 {
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="InternetExplorerDriver"/> class using the specified
 /// <see cref="DriverService"/>, <see cref="InternetExplorerOptions"/>, and command timeout.
 /// </summary>
 /// <param name="service">The <see cref="InternetExplorerDriverService"/> to use.</param>
 /// <param name="options">The <see cref="InternetExplorerOptions"/> used to initialize the driver.</param>
 /// <param name="commandTimeout">The maximum amount of time to wait for each command.</param>
 public InternetExplorerDriver(InternetExplorerDriverService service, InternetExplorerOptions options, TimeSpan commandTimeout)
     : base(new DriverServiceCommandExecutor(service, commandTimeout), options.ToCapabilities())
 {
 }
        private static ICapabilities ConvertOptionsToCapabilities(InternetExplorerOptions options)
        {
            if (options == null)
            {
                throw new ArgumentNullException("options", "options must not be null");
            }

            return options.ToCapabilities();
        }
 /// <summary>
 /// Initializes a new instance of the InternetExplorerDriver class for the specified port, options, and command timeout.
 /// </summary>
 /// <param name="port">The port to use to communicate with the IE server.</param>
 /// <param name="options">The <see cref="InternetExplorerOptions"/> used to initialize the driver.</param>
 /// <param name="commandTimeout">The maximum amount of time to wait for each command.</param>
 public InternetExplorerDriver(int port, InternetExplorerOptions options, TimeSpan commandTimeout)
     : base(GetCommandExecutor(port, options.ToCapabilities(), commandTimeout), options.ToCapabilities())
 {
 }
Beispiel #6
-4
    public static IWebDriver Create(string browser)
    {
        DesiredCapabilities capabilities;
        IWebDriver driver;

        switch (browser) {
            case "chrome":
                capabilities = DesiredCapabilities.Chrome();
                driver = new RemoteWebDriver(remoteWebDriverUri, capabilities);
                break;
            case "internet explorer":
                InternetExplorerOptions options = new InternetExplorerOptions();
                options.IgnoreZoomLevel = true;
                capabilities = (DesiredCapabilities)options.ToCapabilities();
                driver = new RemoteWebDriver(remoteWebDriverUri, capabilities, TimeSpan.FromSeconds(10));
                break;
            case "edge":
                capabilities = DesiredCapabilities.Edge();
                driver = new RemoteWebDriver(remoteWebDriverUri, capabilities);
                break;
            default:
                capabilities = DesiredCapabilities.Firefox();
                driver = new RemoteWebDriver(remoteWebDriverUri, capabilities);
                break;
        }

        return driver;
    }