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


C# DesiredCapabilities.ToString方法代码示例

本文整理汇总了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);
        }
开发者ID:NishantPanchal92,项目名称:BrowserStack-PNUnit,代码行数:25,代码来源:Class1.cs

示例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));
     }
开发者ID:nagarkarv,项目名称:TeamCitySauce,代码行数:16,代码来源:SauceBrowserConfig.cs

示例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));
        }
开发者ID:ndmanvar,项目名称:CSharp-PNUnit-Selenium,代码行数:21,代码来源:SaucePNUnit_Test.cs


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