本文整理匯總了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())
{
}