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


C# AndroidDriver.Quit方法代码示例

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


在下文中一共展示了AndroidDriver.Quit方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: 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

示例2: 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

示例3: StartingAndroidAppWithCapabilitiesOnlyTest

        public void StartingAndroidAppWithCapabilitiesOnlyTest()
        {
            string app = Apps.get("androidApiDemos");
            DesiredCapabilities capabilities =
                Caps.getAndroid19Caps(app);

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

示例4: StartingAndroidAppWithCapabilitiesAndServiceTest

        public void StartingAndroidAppWithCapabilitiesAndServiceTest()
        {
            DesiredCapabilities capabilities = Env.isSauce() ?
                Caps.getAndroid501Caps(Apps.get("androidApiDemos")) :
                Caps.getAndroid19Caps(Apps.get("androidApiDemos"));

            OptionCollector argCollector = new OptionCollector()
                .AddArguments(GeneralOptionList.OverrideSession()).AddArguments(GeneralOptionList.StrictCaps());
            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:yodurr,项目名称:sample-code,代码行数:24,代码来源:StartingAppLocallyTest.cs

示例5: StartingAndroidAppWithCapabilitiesOnTheServerSideTest

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

            DesiredCapabilities serverCapabilities = Env.isSauce() ?
                Caps.getAndroid501Caps(Apps.get("androidApiDemos")) :
                Caps.getAndroid19Caps(Apps.get("androidApiDemos"));

            DesiredCapabilities clientCapabilities = new DesiredCapabilities();
            clientCapabilities.SetCapability(AndroidMobileCapabilityType.AppPackage, "io.appium.android.apis");
            clientCapabilities.SetCapability(AndroidMobileCapabilityType.AppActivity, ".view.WebView1");

            OptionCollector argCollector = new OptionCollector().AddCapabilities(serverCapabilities);
            AppiumServiceBuilder builder = new AppiumServiceBuilder().WithArguments(argCollector);

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

示例6: QuitTestCase

		public void QuitTestCase ()
		{
            AndroidDriver driver = new AndroidDriver(defaultUri, capabilities);
			server.respondTo ("DELETE", "/", null);
			driver.Quit ();
		}
开发者ID:andreypetukhov,项目名称:AppiumGigya,代码行数:6,代码来源:SessionTest.cs


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