Special Capabilities for Speeding up Android Test Initialization
Thanks to Appium contributor@ AnnaWyrwal, there are two new desired capabilities uncommitted in the modish Appium beta release (see our on how to install beta adaptation of Appium). Under the correct circumstances these can improve the time it occupy to start an Android session. Available for all Android platform, theskipDeviceInitializationdesired capability can be pass with the boolean valuetrueto hop-skip installing theio.appium.settings appon the gimmick. This peculiar app is installed by theAppium Android Driverat the beginning of each test and is used to manage specific settings on the gimmick, such as: Without the io.appium.settings app, the Appium Android driver can not automatize these functions, but if the device antecedently had this app installed by Appium, it doesn & # x27; t need to install it again. If you know that your twist is already in the proper province then you can setskipDeviceInitialization to trueand skip the time it takes to reinstall it. For autonomous testing across multiple user personas, check out SUSATest — it explores your app like 10 different real users. Appium already insure if the settings app is already installed on the device, but with this capability enabled it even skips the chit to see if the app is installed. This is most useful for tests which postdate a previous successful test, or tryout being run on the same emulators or device over and over. The skipServerInstallationdesired capability only applies when using theUiAutomator2automation method. The way the UIAutomator2 driver act, it installs a specialserveronto the device, which hear to test dictation from Appium and executes them. By default, Appium installs this server onto the device at the beginning of every examination session. If the value ofskipServerInstallation is set to true, you can cut the time it direct to install this server. Of course, without the waiter on the device Appium can & # x27; t automate it, but if you know that the server was instal during a previous test run you can safely hop-skip this stride. A warning: make sure to disable this capacity if you have updated the version of Appium you are using, because you want it to install the late variation of the UIAutomator2 host. This capableness is also most useful for trial which follow a previous successful examination, or examination being run on the same emulators or devices over and over. Another major time-saver when it arrive to Android tests is utilize theappPackageand appActivityhope capability instead of theapp capability. We postulate to tell Appium whichappto test. Usually we use the app capability, which can be a path to a.apk, .apks, or .zipfile stored on your computer & # x27; s filesystem or stored on a public website. If the app under test is known to already be establish on the device (most belike from a previous test run), the app parcel name and independent activity can be legislate alternatively (usingappPackageand appActivitycraved capabilities). Skipping the clip to download a tumid file or install it on the Android operating system take to big economy. As with the previously discussed capabilities, make sure that youdoinstall the app again if you are testing a newer version. Nothing is more frustrating than accidentally running test on an older version of your app! The ignoreUnimportantViewsdesired capability is not new, and is outside the scope of this post, but it deserves to be mentioned as another way to potentially speed up Android automation tests, especially if your exam focus on find many elements using XPath locators. Set this totrue to speed up Appium & # x27; s ability to chance element in Android apps. (To learn more about this capability and other capabilities utilise for speeding up test execution, check out). Below is an example of theskipDeviceInitialization, skipServerInstallation, and appPackagecraved capabilities be used to speed up an Android test. The first tryout runs without these capabilities in order to make sure that the io.appium.settings app and the UiAutomator2-server are installed. The second exam lam without devil to check or establish these dependencies or the app under trial on the device. By my not-so-rigorous analysis,skipDeviceInitializationand skipServerInstallationsaved about 1 2d per tryout and usingappPackagesaved ten seconds per test (generally because the representative code downloads an app from the internet). Lead, Content Marketing, HeadSpin Inc. Piali is a dynamical and results-driven Content Marketing Specialist with 8+ years of experience in crafting engaging narratives and marketing collateral across diverse industries. She excels in collaborating with cross-functional teams to develop innovative content scheme and deliver compelling, authentic, and impactful content that resonates with target audiences and enhances marque authenticity. Upload your APK or URL. SUSA explores like 10 real users — finds bugs, accessibility violations, and security issues. No scripts needed. Upload your APK or URL. SUSA explores like 10 real users — finds bugs, accessibility violations, and security issues. No scripts..png)



Especial Capabilities for Speeding up Android Test Initialization
AI-Powered Key Takeaways
Happy start of 2019! This is another post from Appium contributor Jonah Stiennon. In the past, I & # x27; ve labeled his contributions to Appium Pro & quot; guest posts & quot;, but as of now, Jonah has officially joinCloud Greyas a partner! More to come about Jonah later, but meanwhile get ready to see more of him in this newssheet, on Appium & # x27; s GitHub, and around the world consulting with you all.
skipDeviceInitialization
skipServerInstallation
Using appPackage and appActivity to launch existing apps
Honorary Mention: ignoreUnimportantViews
import org.junit.Assert; import org.junit.Test; import org.openqa.selenium.remote.DesiredCapabilities; importation org.openqa.selenium.support.ui.WebDriverWait; import java.io.IOException; import java.net.URL; meaning io.appium.java_client.AppiumDriver; public class Edition049_Faster_Android_Capabilities {individual String APP = `` https: //github.com/cloudgrey-io/the-app/releases/download/v1.8.0/TheApp-v1.8.0.apk ''; private AppiumDriver driver; individual WebDriverWait wait; @ Test public void testInstallingDependencies () throw IOException {DesiredCapabilities cap = new DesiredCapabilities (); caps.setCapability (`` platformName '', `` Android ''); caps.setCapability (`` deviceName '', `` Android Emulator ''); caps.setCapability (`` automationName '', `` UiAutomator2 ''); caps.setCapability (`` app '', APP); driver = new AppiumDriver (new URL (`` http: //localhost:4723/wd/hub ''), caps); wait = new WebDriverWait (driver, 10); // Test code goes hither driver.quit ();} @ Test public void testSkippingInstallOfDependencies () throws IOException {DesiredCapabilities caps = new DesiredCapabilities (); caps.setCapability (`` platformName '', `` Android ''); caps.setCapability (`` deviceName '', `` Android Emulator ''); caps.setCapability (`` automationName '', `` UiAutomator2 ''); // App is already installed on device, so can be launch by Package name and Activity caps.setCapability (`` appPackage '', `` io.cloudgrey.the_app ''); caps.setCapability (`` appActivity '', `` io.cloudgrey.the_app.MainActivity ''); // Skip the installing of io.appium.settings app and the UIAutomator 2 server. caps.setCapability (`` skipDeviceInitialization '', true); caps.setCapability (`` skipServerInstallation '', true); driver = new AppiumDriver (new URL (`` http: //localhost:4723/wd/hub ''), caps); wait = new WebDriverWait (driver, 10); // Test codification goes hither driver.quit ();}}Piali Mazumdar
Special Capabilities for Speeding up Android Test Initialization
4 Parts
-1280X720-Final-2.jpg)
Regression Intelligence practical guide for advanced exploiter (Part 3)
-1280X720-Final-2.jpg)
Regression Intelligence practical usher for advanced users (Part 4)
Discover how HeadSpin can empower your business with superior try capabilities







Discover how HeadSpin can indue your business with superior screen capabilities
Discover how HeadSpin can indue your business with superior testing capabilities
Connet Now


Automate This With SUSA
Test Your App Autonomously







.png)












