本文整理汇总了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;
}
示例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())
{
}
示例3: ConvertOptionsToCapabilities
private static ICapabilities ConvertOptionsToCapabilities(InternetExplorerOptions options)
{
if (options == null)
{
throw new ArgumentNullException("options", "options must not be null");
}
return options.ToCapabilities();
}
示例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())
{
}