本文整理汇总了C#中OpenQA.Selenium.Remote.DesiredCapabilities.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# DesiredCapabilities.ToString方法的具体用法?C# DesiredCapabilities.ToString怎么用?C# DesiredCapabilities.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OpenQA.Selenium.Remote.DesiredCapabilities
的用法示例。
在下文中一共展示了DesiredCapabilities.ToString方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Init
public void Init()
{
testParams = PNUnitServices.Get().GetTestParams();
String params1 = String.Join(",", testParams);
Console.WriteLine(params1);
String browser = testParams[0];
String version = testParams[1];
String os = testParams[2];
String os_version = testParams[3];
String platform = testParams[4];
String device = testParams[5];
DesiredCapabilities capability = new DesiredCapabilities();
capability.SetCapability("browserName", browser);
capability.SetCapability(CapabilityType.Version, version);
capability.SetCapability("os", os);
capability.SetCapability("os_version", os_version);
capability.SetCapability("platform", platform);
capability.SetCapability("device", device);
capability.SetCapability("browserstack.user", "<USERNAME>");
capability.SetCapability("browserstack.key", "<ACCESS_KEY>");
Console.WriteLine("Capabilities" + capability.ToString());
driver = new RemoteWebDriver(new Uri("http://hub.browserstack.com:80/wd/hub/"), capability);
}
示例2: SetUpSauce
public void SetUpSauce()
{
_caps = new DesiredCapabilities();
_caps.SetCapability(CapabilityType.BrowserName, _browser);
_caps.SetCapability(CapabilityType.Version, _version);
_caps.SetCapability(CapabilityType.Platform, _os);
_caps.SetCapability("deviceName", _deviceName);
_caps.SetCapability("deviceOrientation", _deviceOrientation);
_caps.SetCapability("username", _username); //SAUCE_LABS_ACCOUNT_NAME
_caps.SetCapability("accessKey", _accessKey); //SAUCE_LABS_ACCOUNT_KEY
_caps.SetCapability("name", TestContext.CurrentContext.Test.Name);
Console.WriteLine("Environment Combination = " + _caps.ToString() + "Platform = " + _os + "_caps Platform = " + _caps.Platform.MajorVersion);
_driver = new RemoteWebDriver(new Uri(_sauceUri), _caps,
TimeSpan.FromSeconds(600));
}
示例3: Init
public void Init()
{
testParams = PNUnitServices.Get().GetTestParams();
String params1 = String.Join(",", testParams);
Console.WriteLine(params1);
String browser = testParams[0];
String version = testParams[1];
String platform = testParams[2];
DesiredCapabilities caps = new DesiredCapabilities();
caps.SetCapability("browserName", browser);
caps.SetCapability(CapabilityType.Version, version);
caps.SetCapability(CapabilityType.Platform, platform);
caps.SetCapability("username", Constants.SAUCE_LABS_ACCOUNT_NAME);
caps.SetCapability("accessKey", Constants.SAUCE_LABS_ACCOUNT_KEY);
caps.SetCapability("name", TestContext.CurrentContext.Test.Name);
Console.WriteLine("Capabilities" + caps.ToString());
driver = new RemoteWebDriver(new Uri("http://ondemand.saucelabs.com:80/wd/hub"), caps, TimeSpan.FromSeconds(600));
//driver.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(180));
}