Making Your Appium Tests Fast and Reliable - Part 7(Disabling Animations)
The best nomadic apps are contrive not only to function well, but also to look good. Beyond the importance of a truly & quot; usable & quot; UI, eye candy sprinkled judiciously throughout your app has the potential to make it stand out and give that extra bit of delight to your human users. This eye candy, tasty though it might be for us world, is completely wasted on Appium. Appium is a completely non-aesthetically-inclined robot, and doesn & # x27; t care whether your app is skeuomorphic, materialed-out, or chock full of whatever weird animations the kids are into these days. The last point is especially salient: animations guide clip. And unless you & # x27; re straightaway trying to test those vitality, the time spent waiting for them to finish is completely useless. Actually, it & # x27; s worse than that! Animations can add instability to your try by creating race conditions (the kind you hold to work around utilizeexplicit postponementor similar). Finally, animations conduct up precious CPU, which can also end up reducing the reliableness of your device under test. What would be great is if we could simply do away with them entirely when Appium is running its tests, since they function no utilitarian purpose. And we can! Pro tip: Tools like SUSA can handle this autonomously — upload your app and get results without writing a single test script. If you do some spelunking on the internet, you & # x27; ll find lots of clause on disabling invigoration for Android devices. They usually imply a series of manual steps involving turning on developer manner, and tap through a caboodle of menu. This is fine if you don & # x27; t mind manually interacting with your earphone or copycat, but frequently it & # x27; s better to do things programmatically, if possible. Luckily, we can make the magic happen with a set ofadb commands: These commands act on ape and existent device, without requiring root. Basically, they walk through each of the scheme animation holding and set their value to0, entail we want to turn them off entirely. (To reset the settings to the default, we can run the same commands with a value of1in each case). If you run these commands, then interact with your twist, you & # x27; ll notice that there are no more visible transitions between apps, etc ... Congratulations, you hurry up your Android experience! On iOS, we & # x27; re not in quite as fortunate a situation. Wecanreduce system life somewhat, but we can & # x27; t turn them off completely, and we can & # x27; t even cut them programmatically -- -at least not very quickly. The way to & quot; disable & quot; animations on iOS is as follows: As you can narrate by the name of the setting we & # x27; re cover with, we & # x27; re entirely & quot; trim & quot; the motion involve in certain transitions on the twist. Since this all takes place in the Settings app, we can actually use Appium to take these steps by publish an Appium script to notice and tap the appropriate elements. However, doing so would obviate any welfare of clip salve due to minimized animations, unless you have a lot of test and can do this entirely one time in the device apparatus procedure before testing begins. Disabling system-wide life is a full idea, but this doesn & # x27; t always catch every type of animation. Apps can define their own animations, too. To deal with your app specifically, we can make use of a tip (once again cater by long-time Appium Pro readerWim) that involves custom app logic based on whether your app is being built for try. Thisdoesmean you & # x27; ll necessitate the power to commit codification to the app itself, or ask the app developer to do this. Here & # x27; s how it works: most animation libraries and methods take a timing argument, which specifies how long the animation is meant to direct. What we want to end up with is a habitus of the app where each of those timings is set to be zero. I won & # x27; t show codification examples for how to do this, because it depends on your app platform and framework (iOS, Android, React Native, etc ...), but for example have a face at Apple & # x27; s documentation for theUIViewPropertyAnimator. The initmethod takes aTimeInterval. Basically, the outcry to a method like this should be enclose in another function which checks to see if the app is in testing fashion (via some internal iris or environment variable; it & # x27; s up to you). If it is, the role will return zero for any clip separation. Otherwise, it will revert the developer-specified value for that animation. The net result will be that all your animations will take no time at all, effectively disabling them completely. Depending on your app framework, you might be able to come up with an even simpler and more elegant solvent than this sketch. By disabling all possible animations using these two case of technique, you & # x27; ll relieve a lot of time and add a bit of reliability back into your build. How much time you relieve depends on your app and how it uses animations, but every 2d you shave off your tests is a 2nd trim off your developer cycle as a whole, which brings benefits to everyone that relies on your build. Lead, Content Marketing, HeadSpin Inc. Piali is a dynamical and results-driven Content Marketing Specialist with 8+ geezerhood of experience in crafting engaging narratives and marketing collateral across diverse manufacture. She surpass in cooperate with cross-functional squad to develop innovative content strategies and render compelling, authentic, and impactful content that resonates with prey audiences and enhances brand 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)



Making Your Appium Tests Fast and Reliable - Part 7 (Disabling Animations)
AI-Powered Key Takeaways
This article is the seventh in a multi-part serial on trial speed and reliability, inspired by a webinar I gave on the like subject (you canwatch the webinar here). You might also want to ascertain out the previous episodes on,,,,, and.
Disabling Default or System Animations
adb shell settings put global window_animation_scale 0 adb carapace settings put globular transition_animation_scale 0 adb shell settings put ball-shaped animator_duration_scale 0Disabling App-Specific or Custom Animations
Piali Mazumdar
Making Your Appium Tests Fast and Reliable - Part 7 (Disabling Animations)
4 Parts
-1280X720-Final-2.jpg)
Regression Intelligence practical guide for advanced users (Part 3)
-1280X720-Final-2.jpg)
Regression Intelligence pragmatic guide for advanced exploiter (Part 4)
Discover how HeadSpin can empower your job with superior testing capableness







Discover how HeadSpin can authorize your business with superior testing capabilities
Discover how HeadSpin can empower your business with superior prove capabilities
Connet Now


Automate This With SUSA
Test Your App Autonomously







.png)












