當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。