public void BeforeAll() { var capabilities = Env.ServerIsRemote() ? Caps.GetAndroidCaps(Apps.Get("androidApiDemos")) : Caps.GetAndroidCaps(Apps.Get("androidApiDemos")); var serverUri = Env.ServerIsRemote() ? AppiumServers.RemoteServerUri : AppiumServers.LocalServiceUri; _driver = new AndroidDriver <AppiumWebElement>(serverUri, capabilities, Env.InitTimeoutSec); var timeSpan = new TimeOutDuration(new TimeSpan(0, 0, 0, 5, 0)); _pageObject = new AndroidPageObjectChecksAttributesForNativeAndroidApp(); PageFactory.InitElements(_driver, _pageObject, new AppiumPageObjectMemberDecorator(timeSpan)); }
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 - complex"); capabilities.SetCapability("tags", new string[] { "sample" }); } Uri serverUri = Env.isSauce() ? AppiumServers.sauceURI : AppiumServers.LocalServiceURIAndroid; driver = new AndroidDriver <AppiumWebElement>(serverUri, capabilities, Env.INIT_TIMEOUT_SEC); TimeOutDuration timeSpan = new TimeOutDuration(new TimeSpan(0, 0, 0, 5, 0)); pageObject = new AndroidPageObjectChecksAttributesForNativeAndroidApp(); PageFactory.InitElements(driver, pageObject, new AppiumPageObjectMemberDecorator(timeSpan)); }