コード例 #1
0
        public void StartingIOSAppWithCapabilitiesAndServiseTest()
        {
            string app = Apps.get("iosTestApp");

            DesiredCapabilities capabilities = new DesiredCapabilities();

            capabilities.SetCapability(MobileCapabilityType.DeviceName, "iPhone Simulator");

            OptionCollector argCollector = new OptionCollector().AddArguments(GeneralOptionList.App(app))
                                           .AddArguments(GeneralOptionList.AutomationName(AutomationName.Appium)).
                                           AddArguments(GeneralOptionList.PlatformVersion("8.2"));

            AppiumServiceBuilder         builder = new AppiumServiceBuilder().WithArguments(argCollector);
            IOSDriver <AppiumWebElement> driver  = null;

            try
            {
                driver = new IOSDriver <AppiumWebElement>(builder, capabilities, Env.INIT_TIMEOUT_SEC);
                driver.CloseApp();
            }
            finally
            {
                if (driver != null)
                {
                    driver.Quit();
                }
            }
        }