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