当前位置: 首页>>代码示例>>C#>>正文


C# InternetExplorerOptions.ToCapabilities方法代码示例

本文整理汇总了C#中OpenQA.Selenium.IE.InternetExplorerOptions.ToCapabilities方法的典型用法代码示例。如果您正苦于以下问题:C# InternetExplorerOptions.ToCapabilities方法的具体用法?C# InternetExplorerOptions.ToCapabilities怎么用?C# InternetExplorerOptions.ToCapabilities使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在OpenQA.Selenium.IE.InternetExplorerOptions的用法示例。


在下文中一共展示了InternetExplorerOptions.ToCapabilities方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Create

    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;
    }
开发者ID:chrhol,项目名称:Launcher,代码行数:28,代码来源:WebDriverFactory.cs

示例2: InternetExplorerDriver

 /// <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())
 {
 }
开发者ID:emakiej,项目名称:selenium,代码行数:11,代码来源:InternetExplorerDriver.cs

示例3: ConvertOptionsToCapabilities

        private static ICapabilities ConvertOptionsToCapabilities(InternetExplorerOptions options)
        {
            if (options == null)
            {
                throw new ArgumentNullException("options", "options must not be null");
            }

            return options.ToCapabilities();
        }
开发者ID:draculavlad,项目名称:selenium,代码行数:9,代码来源:InternetExplorerDriver.cs

示例4: InternetExplorerDriver

 /// <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())
 {
 }
开发者ID:jamesoram,项目名称:Selenium2,代码行数:10,代码来源:InternetExplorerDriver.cs


注:本文中的OpenQA.Selenium.IE.InternetExplorerOptions.ToCapabilities方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。