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


C# Android.AndroidDriver类代码示例

本文整理汇总了C#中OpenQA.Selenium.Appium.Android.AndroidDriver的典型用法代码示例。如果您正苦于以下问题:C# AndroidDriver类的具体用法?C# AndroidDriver怎么用?C# AndroidDriver使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


AndroidDriver类属于OpenQA.Selenium.Appium.Android命名空间,在下文中一共展示了AndroidDriver类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: RunBeforeEach

		public void RunBeforeEach()
		{
			server.respondToInit ();
			DesiredCapabilities capabilities = new DesiredCapabilities();
            AndroidDriver driver = new AndroidDriver(defaultUri, capabilities);
			server.clear ();
		}
开发者ID:andreypetukhov,项目名称:AppiumGigya,代码行数:7,代码来源:SessionTest.cs

示例2: StartingAndroidAppWithCapabilitiesAndServiceTest

        public void StartingAndroidAppWithCapabilitiesAndServiceTest()
        {
            string app = Apps.get("androidApiDemos");

            DesiredCapabilities capabilities = new DesiredCapabilities();
            capabilities.SetCapability(MobileCapabilityType.DeviceName, "Android Emulator");

            OptionCollector argCollector = new OptionCollector().AddArguments(GeneralOptionList.App(app))
                .AddArguments(GeneralOptionList.AutomationName(AutomationName.Appium));
            AppiumServiceBuilder builder = new AppiumServiceBuilder().WithArguments(argCollector);

            AndroidDriver<AppiumWebElement> driver = null;
            try
            {
                driver = new AndroidDriver<AppiumWebElement>(builder, capabilities);
                driver.CloseApp();
            }
            finally
            {
                if (driver != null)
                {
                    driver.Quit();
                }
            }
        }
开发者ID:FlawlessFalcon,项目名称:sample-code,代码行数:25,代码来源:StartingAppLocallyTest.cs

示例3: GetCurrentActivityTestCase

 public void GetCurrentActivityTestCase()
 {
     AndroidDriver<IWebElement> driver = new AndroidDriver<IWebElement>(defaultUri, capabilities);
     server.respondTo("GET", "/appium/device/current_activity", ".activities.PeopleActivity");
     string activity = driver.CurrentActivity;
     Assert.AreEqual(activity, ".activities.PeopleActivity");
 }
开发者ID:jonstoneman,项目名称:appium-dotnet-driver,代码行数:7,代码来源:MJsonMethodTest.cs

示例4: GetAppStringsTestCase

 public void GetAppStringsTestCase()
 {
     AndroidDriver driver = new AndroidDriver(defaultUri, capabilities);
     var data = "21343n2312j3jw";
     server.respondTo ("POST", "/appium/app/strings", data);
     var result = driver.GetAppStrings ();
     Assert.AreEqual (result, data);
 }
开发者ID:andreypetukhov,项目名称:AppiumGigya,代码行数:8,代码来源:MJsonMethodTest.cs

示例5: EndTestCoverageTestCase

 public void EndTestCoverageTestCase()
 {
     AndroidDriver driver = new AndroidDriver(defaultUri, capabilities);
     var data = "21343n2312j3jw";
     server.respondTo ("POST", "/appium/app/end_test_coverage", data);
     var result = driver.EndTestCoverage ("android.intent.action.BOOT_COMPLETED", "/random/path");
     Assert.AreEqual (result, data);
 }
开发者ID:andreypetukhov,项目名称:AppiumGigya,代码行数:8,代码来源:MJsonMethodTest.cs

示例6: BeforeAll

 public void BeforeAll()
 {
     DesiredCapabilities capabilities =
         Caps.getAndroid19Caps(Apps.get("androidApiDemosLocal"));
     Uri serverUri = AppiumServers.localURI;
     driver = new AndroidDriver<AndroidElement>(serverUri, capabilities, Env.INIT_TIMEOUT_SEC);
     driver.Manage().Timeouts().ImplicitlyWait(Env.IMPLICIT_TIMEOUT_SEC);
 }
开发者ID:k-yamada,项目名称:AppiumWindowsSample,代码行数:8,代码来源:AndroidSimpleTest.cs

示例7: InitBrowser

 public void InitBrowser()
 {
     DesiredCapabilities capabilities = new DesiredCapabilities();
     capabilities.SetCapability("deviceName", "AF2");
     capabilities.SetCapability("app", "D:/BYTA/Framework/BYTA_AF_Framework_Task5/MobileTests/com.basecamp.bc3.apk");
     capabilities.SetCapability("appPackage", "com.basecamp.bc3");
     capabilities.SetCapability("appWaitActivity", "com.basecamp.bc3.activities.AuthChooserActivity");
     capabilities.SetCapability("unicodeKeyboard", true);
     driver = new AndroidDriver<IWebElement>(new Uri("http://127.0.0.1:4723/wd/hub"), capabilities);
 }
开发者ID:AliakseiF,项目名称:BYTA_AF_Framework,代码行数:10,代码来源:TestBase.cs

示例8: Main

        static void Main(string[] args)
        {
            AndroidDriver<AndroidElement> driver;
            var INIT_TIMEOUT_SEC = TimeSpan.FromSeconds(180);
            var Capabilities=new DesiredCapabilities();
            var serverUrl = new Uri("http://172.0.0.1:4723/wd/hub");

              //  Capabilities.SetCapability(CapabilityType.BrowserName,"");
            Capabilities.SetCapability(MobileCapabilityType.DeviceName,"Android");
            //Capabilities.SetCapability(MobileCapabilityType.AppActivity,"");
            //Capabilities.SetCapability(MobileCapabilityType.AppPackage,"");
            Capabilities.SetCapability(MobileCapabilityType.AppiumVersion, "1.4.13");
            Capabilities.SetCapability(MobileCapabilityType.App,@"C:/sample-code/apps/ApiDemos-debug.apk");

            driver=new AndroidDriver<AndroidElement>(serverUrl,Capabilities,INIT_TIMEOUT_SEC);
            driver.Manage().Timeouts().ImplicitlyWait(INIT_TIMEOUT_SEC);

            driver.FindElementByName("Graphics").Click();
            driver.ScrollTo("FingerPaint", "android:id/list");
            driver.FindElementByName("FingerPaint").Click();
            AndroidElement element = driver.FindElementById("android:id/content");
            Point point = element.Coordinates.LocationInDom;
            Size size = element.Size;
            driver.Swipe
            (
                point.X + 5,
                point.Y + 5,
                point.X + size.Width - 5,
                point.Y + size.Height - 5,
                200
            );

            driver.Swipe
            (
                point.X + size.Width - 5,
                point.Y + 5,
                point.X + 5,
                point.Y + size.Height - 5,
                2000
            );

             driver.FindElementByName("Graphics").Click();
            driver.ScrollTo("OpenGL ES", "android:id/list").Click();
            //driver.FindElementByName("OpenGL ES").Click();
            driver.ScrollTo("Touch Rotate", "android:id/list").Click();
            //driver.FindElementByName("TouchRotate").Click();

            AndroidElement element1 = driver.FindElementById("android:id/content");
            driver.Pinch(element1);
            driver.Zoom(element1);

            Thread.Sleep(2000);

              driver.Quit();
        }
开发者ID:karlpig,项目名称:AutomaticMobileFlux,代码行数:55,代码来源:Program.cs

示例9: Android

 public Android (string deviceID,string package,string activity)
 {
     DesiredCapabilities capabilities = new DesiredCapabilities();
     capabilities.SetCapability(CapabilityType.BrowserName, "");
     capabilities.SetCapability(MobileCapabilityType.AppiumVersion, "1.0");
     capabilities.SetCapability(MobileCapabilityType.PlatformVersion, "4.4.2");
     capabilities.SetCapability(MobileCapabilityType.DeviceName, deviceID);
     capabilities.SetCapability("autoLaunch", false);
     capabilities.SetCapability(MobileCapabilityType.AppPackage, package);
     capabilities.SetCapability(MobileCapabilityType.AppActivity, activity);
     driver = new AndroidDriver<AppiumWebElement>(serverUri, capabilities, TimeSpan.FromSeconds(60));
 }
开发者ID:cedarwy,项目名称:AppuimTestTools,代码行数:12,代码来源:Android.cs

示例10: beforeAll

        public void beforeAll()
        {
            DesiredCapabilities capabilities = new DesiredCapabilities();

            capabilities.SetCapability("deviceName", "Google Nexus 6 - 5.0.0 - API 21 - 1400x2560");
            capabilities.SetCapability("platformName", "Android");
            capabilities.SetCapability("app", AppPath);

            _driver = new AndroidDriver<AppiumWebElement>(
                                                    new Uri(DeviceAddress),
                                                    capabilities);
        }
开发者ID:evolit,项目名称:Appium.DotNet.TestingCommands,代码行数:12,代码来源:ProgramTest.cs

示例11: BeforeAll

		public void BeforeAll(){
			DesiredCapabilities capabilities = Env.isSauce () ? 
				Caps.getAndroid501Caps (Apps.get ("androidApiDemos")) :
				Caps.getAndroid19Caps (Apps.get ("androidApiDemos"));
			if (Env.isSauce ()) {
				capabilities.SetCapability("username", Env.getEnvVar("SAUCE_USERNAME")); 
				capabilities.SetCapability("accessKey", Env.getEnvVar("SAUCE_ACCESS_KEY"));
				capabilities.SetCapability("name", "android - simple");
				capabilities.SetCapability("tags", new string[]{"sample"});
			}
			Uri serverUri = Env.isSauce () ? AppiumServers.sauceURI : AppiumServers.LocalServiceURIAndroid;
            driver = new AndroidDriver<AndroidElement>(serverUri, capabilities, Env.INIT_TIMEOUT_SEC);	
			driver.Manage().Timeouts().ImplicitlyWait(Env.IMPLICIT_TIMEOUT_SEC);
		}
开发者ID:trbnb,项目名称:appium-dotnet-driver,代码行数:14,代码来源:AndroidSearchingTest.cs

示例12: BeforeAll

 public void BeforeAll()
 {
     DesiredCapabilities capabilities = Env.isSauce () ?
         Caps.getAndroid18Caps (Apps.get ("selendroidTestApp")) :
         Caps.getAndroid19Caps (Apps.get ("selendroidTestApp"));
     if (Env.isSauce ()) {
         capabilities.SetCapability("username", Env.getEnvVar("SAUCE_USERNAME"));
         capabilities.SetCapability("accessKey", Env.getEnvVar("SAUCE_ACCESS_KEY"));
         capabilities.SetCapability("name", "android - webview");
         capabilities.SetCapability("tags", new string[]{"sample"});
     }
     Uri serverUri = Env.isSauce () ? AppiumServers.sauceURI : AppiumServers.localURI;
     driver.Manage().Timeouts().ImplicitlyWait(Env.IMPLICIT_TIMEOUT_SEC);
     driver = new AndroidDriver<IWebElement>(capabilities);
 }
开发者ID:teddym6,项目名称:appiumDotNet,代码行数:15,代码来源:AndroidWebviewTest.cs

示例13: BeforeAll

 public void BeforeAll()
 {
     DesiredCapabilities capabilities = Env.isSauce() ?
         Caps.getAndroid18Caps(Apps.get("selendroidTestApp")) :
         Caps.getAndroid19Caps(Apps.get("selendroidTestApp"));
     if (Env.isSauce())
     {
         capabilities.SetCapability("username", Env.getEnvVar("SAUCE_USERNAME"));
         capabilities.SetCapability("accessKey", Env.getEnvVar("SAUCE_ACCESS_KEY"));
         capabilities.SetCapability("tags", new string[] { "sample" });
     }
     Uri serverUri = Env.isSauce() ? AppiumServers.sauceURI : AppiumServers.localURI;
     driver = new AndroidDriver<AppiumWebElement>(serverUri, capabilities, Env.INIT_TIMEOUT_SEC);
     pageObject = new AndroidJavaScriptTestPageObject(driver);
     driver.StartActivity("io.selendroid.testapp", ".WebViewActivity");
 }
开发者ID:pver,项目名称:appium-dotnet-driver,代码行数:16,代码来源:AndroidJSWebViewTest.cs

示例14: Inisialized

        public void Inisialized()
        {
            DesiredCapabilities capabilities = new DesiredCapabilities();

            capabilities.SetCapability("deviceName", "Nexus 5");
            capabilities.SetCapability("platformName", "Android");
            capabilities.SetCapability("app", @"C:\Users\Administrator\AppData\Roaming\Skype\My Skype Received Files\purevpn-release.apk");
            capabilities.SetCapability("platformVersion", "4.4");
            capabilities.SetCapability("appPackage", "com.gaditek.purevpnics");
            // capabilities.SetCapability("appPackage", "com.gaditek.purevpnics.main.SplashActivity");
            // capabilities.SetCapability("appActivity", "com.gaditek.purevpnics.main.MainActivity");
            capabilities.SetCapability("appActivity", "com.gaditek.purevpnics.main.AuthActivity");
            //   WebDriverWait wait = new WebDriverWait(driver, 10);

            driver = new AndroidDriver<AppiumWebElement>(new Uri("http://127.0.0.1:8082/wd/hub"), capabilities);
        }
开发者ID:gaditek,项目名称:appium-test-obj-1,代码行数:16,代码来源:NUnitTest1.cs

示例15: BeforeAll

 public void BeforeAll()
 {
     DesiredCapabilities capabilities =
         Caps.getSelendroid16Caps(Apps.get("selendroidTestApp"));
     if (Env.isSauce())
     {
         capabilities.SetCapability("username", Env.getEnvVar("SAUCE_USERNAME"));
         capabilities.SetCapability("accessKey", Env.getEnvVar("SAUCE_ACCESS_KEY"));
         capabilities.SetCapability("name", "android - complex");
         capabilities.SetCapability("tags", new string[] { "sample" });
     }
     Uri serverUri = Env.isSauce() ? AppiumServers.sauceURI : AppiumServers.localURI;
     driver = new AndroidDriver<AppiumWebElement>(serverUri, capabilities, Env.INIT_TIMEOUT_SEC);
     TimeOutDuration timeSpan = new TimeOutDuration(new TimeSpan(0, 0, 0, 5, 0));
     pageObject = new AndroidPageObjectChecksSelendroidModeOnNativeApp();
     PageFactory.InitElements(driver, pageObject, new AppiumPageObjectMemberDecorator(timeSpan));
 }
开发者ID:illyric,项目名称:sample-code,代码行数:17,代码来源:AndroidTestThatChecksAttributeMix3SelendroidMode.cs


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