Making Your Appium Tests Fast and Reliable, Part 6: Tuning Your Capabilities
Appium session are not just Appium sessions. Or at least, they don & # x27; t receive to be. When you start a session, you can tweak the way Appium operates by substance of session initialization parameters cognize as & quot; want capabilities & quot; (in Selenium parlance; in the language of the W3C WebDriver spec they are simply & quot; capabilities & quot;). We all know about capability (which we all love to foreshorten as & quot; caps & quot;) because we experience to get dirty with them just to begin a tryout successfully, using capability likeplatformNameor deviceNameto let Appium know what kind of thing we & # x27; re interested in automating. Appium actually supports a host ofearly capabilities-- -over 100 of them, actually. All these optional caps fundamentally tell Appium to bear differently. There are detonator to tweak default timeouts, to set the language on a device before the session, to adjust the orientation, or work with a host of system-specific issues like itinerary to crucial binary or which ports Appium should use for its internal mechanism. Some of these capabilities are useful from the perspective of speeding or dependableness, and can aid steady trial, especially if you find yourself in the specific scenario that they were designed to direct. So, let & # x27; s conduct a expression! By default, Appium runs a reset process after each session, to ensure that a device and app are as fresh and clean as when they first arrived. This of trend is important for ensuring determinism in your test suite: you don & # x27; t need the aftereffect of one test to change the operation of a subsequent exam! If your examinationdon & # x27; tinvolve this kind of clean state, and you & # x27; re absolutely certain of it, you can set this capacity totrue to avoid some of the time-consuming cleaning subroutines. If you don & # x27; t need the safety, guide a crosscut for the sake of speed! The opponent of the late cap isfullReset, which does stillmorecleansing than by nonpayment. Set this cap totrue to add even more time-consuming cleaning subroutines. This might be necessary if the nonremittal cleanup is not enough to create your build reliable, and you know that the imbalance is due to leftover state from previous tests. Both iOS and Android experience the concept of & # x27;headless& # x27; virtual device, and Appium can still work with devices that are scarper in this mode. Set this cap totrue to launch a simulator or emulator in headless mode, potentially guide to a performance boost, especially if you & # x27; re running in a virtualized or resource-constrained surroundings (such as a VM farm). Of trend, in brainless mode any tooling you get around taking videos or screenshots outside of Appium will not work. SUSA automates exploratory testing with persona-driven behavior, catching bugs that scripted automation misses. The only way to check for toast message on Android is for the Appium UiAutomator2 driver to run a grommet constantly ensure the state of the twist. Running a loop like this takes up valuable CPU rhythm and has been observed to make scrolling less ordered, for example. If you don & # x27; t need the features that require the watcher grommet (like toast verification), then set this cap totrueto become it off entirely and save your gimmick some cycles. Set to true to hold Appium attempt to mechanically determine your app permissions and grant them, for instance to avoid system popups asking for license later on in the examination. Appium doesn & # x27; t acquire that your gimmick is unsecured, and it should be to successfully run tests. So it installs and runs a slight helper app that tries to unlock the screen before a test. Sometimes this act, and sometimes this doesn & # x27; t. But that & # x27; s beside the point: either way, it takes time! If you know your screen is unlocked, because you & # x27; re managing screen state with something other than Appium, tell Appium not to devil with this little startup routine and save yourself a second or three, by setting this cap totrue. Android activities can be kind of funny. In many apps, the activity used to launch the app is not the same as the activity which is fighting when the user initially interacts with the coating. Typically it & # x27; s this latter action you like about when you run an Appium test. You need to make sure that Appium doesn & # x27; t view the session started untilthisactivity is active, regardless of what happen to the launching activity. In this scenario, you need to tell Appium to wait for the correct activity, since the one it automatically find from your app manifest will be the launch activity. You can use theappWaitPackageand appWaitActivityto tell Appium to consider a session begin (and hence return control to your tryout codification) only when the package and activity set have become active. This can greatly help the stability of session starting, because your test code can adopt your app is on the activity expects when the session starts. Android has two modality for expressing its layout hierarchy: normal and & quot; compressed & quot;. The compressed layout hierarchy is a subset of the hierarchy that the OS itself sees, restricted to component which the OS think are more relevant for users, for example component with approachability information set on them. Because compressed mode give a smaller XML file, and perhaps for other Android-internal reasons, it & # x27; s frequently faster to get the hierarchy in compressed way. If you & # x27; re running into page source queries taking a very long time, you might try setting this cap totrue. Note that the XML returned in the different style is ... different. Which means that XPath query that worked in one mode will likely not work in the other. Make sure you don & # x27; t change this dorsum and forth if you swear on XPath! Typically, Appium employxcodebuildunder the hood to both build WebDriverAgent and kick off the XCUITest process that power the examination session. If you have a prebuilt WebDriverAgent binary and would like to preserve some time on startup, set theusePrebuiltWDAcap to true. This cap could be utilize in conjunction withderivedDataPath, which is the path to the derived data folder where your WebDriverAgent binary is ditch by Xcode. For orotund applications, it can be faster for Appium to deal with the app hierarchy internally as JSON, rather than XML, and convert it to XML at the & quot; edge & quot;, so to speak -- -in the Appium driver itself, rather than low in the stack. Basically, give this a try if getting the iOS app germ is occupy everlastingly. Sometimes, large iOS applications can take a piece to launch, but there & # x27; s no way for Appium to mechanically detect when an app is ready for use or not. If you have such an app, set this cap to the number of millisecond you & # x27; d like Appium to wait after WebDriverAgent thinks the app is online, before Appium hands back control to your examination script. It might assist create session startup a bit more stable. If you notice errors during typewriting, for exemplar the improper keys be pressed or visual oddities you notice while watching a test, try slowing the typewrite down. Set this cap to an integer and play around with the value until things work. Low-toned is obtuse, higher is faster! The default is60. Appium has its own methods for enchant screenshots from simulators and devices, but specially on existent device this can be slow and/or flaky. If you & # x27; re a fan of thelibimobiledevicesuite and happen to haveidevicescreenshoton your scheme, you can use this cap to let Appium cognise you & # x27; d opt to retrieve the screenshot via a call to that binary instead of using its own internal methods. To make it happen, simply set this cap to the string & quot; idevicescreenshot & quot;! Element visibility checks in XCUITest are fraught with flakiness and complexity. By default, the profile control available don & # x27; t always do a outstanding job. Appium enforce another eccentric of visibility tab inside of WebDriverAgent that might be more reliable for your app, though it comes with the downside that the cheque could conduct longer for some apps. As with many things in life, we sometimes have to make trade-offs between fastness and dependability. Well, I hope you found something in the list above that was intriguing, or that mayhap you didn & # x27; t already know about. Don & # x27; t forget to check the Appium docs sporadically, as many feature or workarounds are create available through the ever-growing set of available capacity! Lead, Content Marketing, HeadSpin Inc. Piali is a dynamic and results-driven Content Marketing Specialist with 8+ years of experience in crafting engaging narration and marketing collateral across divers manufacture. She excels in collaborating with cross-functional squad to evolve innovational content strategies and render compelling, authentic, and impactful content that resonates with quarry audiences and enhances brand genuineness. 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)



Making Your Appium Tests Fast and Reliable, Part 6: Tuning Your Capabilities
AI-Powered Key Takeaways
This article is the 6th in a multi-part series on tryout velocity and reliability, instigate by a webinar I gave on the same subject (you canwatch the webinar hither). You might too require to control out the previous episodes on,,,, and.
Cross-platform Capabilities
noReset
fullReset
isHeadless
Android-specific Capabilities
disableAndroidWatchers
autoGrantPermission
skipUnlock
appWaitPackage and appWaitActivity
ignoreUnimportantViews
iOS-specific Capabilities
usePrebuiltWDA and derivedDataPath
useJSONSource
iosInstallPause
maxTypingFrequency
realDeviceScreenshotter
simpleIsVisibleCheck
Piali Mazumdar
Making Your Appium Tests Fast and Reliable, Part 6: Tuning Your Capabilities
4 Parts
-1280X720-Final-2.jpg)
Regression Intelligence practical usher for advanced user (Part 3)
-1280X720-Final-2.jpg)
Regression Intelligence practical guide for advanced users (Part 4)
Discover how HeadSpin can empower your job with superior try capabilities







Discover how HeadSpin can authorise your business with superior screen capabilities
Discover how HeadSpin can authorize your concern with superior testing capacity
Connet Now


Automate This With SUSA
Test Your App Autonomously







.png)












