private void Initialize() { var args = new OptionColector().AddArguments(GeneralOptionList.PreLaunch()); _appiumLocalService = new AppiumServiceBuilder().UsingAnyFreePort().Build(); _appiumLocalService.Start(); }
public static void StartAppiumLocalService() { if (_shouldStartAppiumLocalService) { var args = new OptionCollector().AddArguments(GeneralOptionList.PreLaunch()); WrappedAppiumCreateService.AppiumLocalService = new AppiumServiceBuilder().WithArguments(args).UsingAnyFreePort().Build(); WrappedAppiumCreateService.AppiumLocalService.Start(); } }
Uri IDriverService.Start() { var args = new OptionCollector().AddArguments(GeneralOptionList.PreLaunch()); _appiumLocalService = new AppiumServiceBuilder().WithArguments(args).UsingAnyFreePort().Build(); _appiumLocalService.Start(); Assert.IsTrue(_appiumLocalService.IsRunning); return(_appiumLocalService.ServiceUrl); }
//start appium local service public static void StartAppium() { var appiumLogBasedir = ".\\Logs\\Appium\\"; var appiumLogCreateDir = Directory.CreateDirectory(appiumLogBasedir); var fileName = appiumLogBasedir + "\\appiumLog.txt"; if (!File.Exists(fileName)) { File.Create(fileName); } var logFile = new FileInfo(fileName); var args = new OptionCollector().AddArguments(GeneralOptionList.PreLaunch()); appiumLocalService = new AppiumServiceBuilder().WithIPAddress("127.0.0.1").WithLogFile(logFile).Build(); appiumLocalService.Start(); }
public static void ClassInitialize(TestContext context) { var args = new OptionCollector().AddArguments(GeneralOptionList.PreLaunch()); _appiumLocalService = new AppiumServiceBuilder().UsingAnyFreePort().Build(); _appiumLocalService.Start(); var desiredCaps = new DesiredCapabilities(); desiredCaps.SetCapability(MobileCapabilityType.DeviceName, "Android_Accelerated_x86_Oreo"); desiredCaps.SetCapability(MobileCapabilityType.PlatformName, "Android"); desiredCaps.SetCapability(MobileCapabilityType.PlatformVersion, "7.1"); desiredCaps.SetCapability(MobileCapabilityType.BrowserName, "Chrome"); _driver = new AndroidDriver <AppiumWebElement>(_appiumLocalService, desiredCaps); _driver.CloseApp(); }
public static void ClassInitialize(TestContext context) { var args = new OptionCollector().AddArguments(GeneralOptionList.PreLaunch()); _appiumLocalService = new AppiumServiceBuilder().UsingAnyFreePort().Build(); _appiumLocalService.Start(); string testAppPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Resources", "selendroid-test-app-0.10.0.apk"); var desiredCaps = new DesiredCapabilities(); desiredCaps.SetCapability(MobileCapabilityType.DeviceName, "Android_Accelerated_x86_Oreo"); desiredCaps.SetCapability(MobileCapabilityType.PlatformName, "Android"); desiredCaps.SetCapability(MobileCapabilityType.PlatformVersion, "7.1"); desiredCaps.SetCapability(AndroidMobileCapabilityType.AppPackage, "io.selendroid.testapp"); desiredCaps.SetCapability(AndroidMobileCapabilityType.AppActivity, "HomeScreenActivity"); _driver = new AndroidDriver <AppiumWebElement>(_appiumLocalService, desiredCaps); _driver.CloseApp(); }
public static void ClassInitialize(TestContext context) { var args = new OptionCollector().AddArguments(GeneralOptionList.PreLaunch()); _appiumLocalService = new AppiumServiceBuilder().UsingAnyFreePort().Build(); _appiumLocalService.Start(); string testAppPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Resources", "ApiDemos-debug.apk"); var appiumOptions = new AppiumOptions(); appiumOptions.AddAdditionalCapability(MobileCapabilityType.DeviceName, "Android_Accelerated_x86_Oreo"); appiumOptions.AddAdditionalCapability(AndroidMobileCapabilityType.AppPackage, "io.appium.android.apis"); appiumOptions.AddAdditionalCapability(MobileCapabilityType.PlatformName, "Android"); appiumOptions.AddAdditionalCapability(MobileCapabilityType.PlatformVersion, "7.1"); appiumOptions.AddAdditionalCapability(AndroidMobileCapabilityType.AppActivity, ".graphics.TouchRotateActivity"); appiumOptions.AddAdditionalCapability(MobileCapabilityType.App, testAppPath); _driver = new AndroidDriver <AppiumWebElement>(_appiumLocalService, appiumOptions); _driver.CloseApp(); }
public static void ClassInitialize(TestContext context) { var args = new OptionCollector().AddArguments(GeneralOptionList.PreLaunch()); _appiumLocalService = new AppiumServiceBuilder().UsingAnyFreePort().Build(); _appiumLocalService.Start(); string testAppPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Resources", "ApiDemos-debug.apk"); var desiredCaps = new DesiredCapabilities(); desiredCaps.SetCapability(MobileCapabilityType.DeviceName, "Android_Accelerated_x86_Oreo"); desiredCaps.SetCapability(AndroidMobileCapabilityType.AppPackage, "com.example.android.apis"); desiredCaps.SetCapability(MobileCapabilityType.PlatformName, "Android"); desiredCaps.SetCapability(MobileCapabilityType.PlatformVersion, "7.1"); desiredCaps.SetCapability(AndroidMobileCapabilityType.AppActivity, ".view.ControlsMaterialDark"); desiredCaps.SetCapability(MobileCapabilityType.App, testAppPath); _driver = new AndroidDriver <AndroidElement>(_appiumLocalService, desiredCaps); _driver.CloseApp(); }
public static void ClassInitialize(TestContext context) { var args = new OptionCollector() .AddArguments(GeneralOptionList.PreLaunch()) .AddArguments(new KeyValuePair <string, string>("--relaxed-security", string.Empty)); _appiumLocalService = new AppiumServiceBuilder().WithArguments(args).UsingAnyFreePort().Build(); _appiumLocalService.Start(); string testAppPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Resources", "ApiDemos-debug.apk"); var appiumOptions = new AppiumOptions(); appiumOptions.AddAdditionalCapability(MobileCapabilityType.AutomationName, "UiAutomator2"); appiumOptions.AddAdditionalCapability(MobileCapabilityType.DeviceName, "android25-test"); appiumOptions.AddAdditionalCapability(AndroidMobileCapabilityType.AppPackage, "com.example.android.apis"); appiumOptions.AddAdditionalCapability(MobileCapabilityType.PlatformName, "Android"); appiumOptions.AddAdditionalCapability(MobileCapabilityType.PlatformVersion, "7.1"); appiumOptions.AddAdditionalCapability(AndroidMobileCapabilityType.AppActivity, ".ApiDemos"); appiumOptions.AddAdditionalCapability(MobileCapabilityType.App, testAppPath); _driver = new AndroidDriver <AndroidElement>(_appiumLocalService, appiumOptions); _driver.CloseApp(); }