Mobile Automation Testing is a must for every project nowadays. I am not going to talk about advantages and disadvantages of Automation Testing here. I want to discuss about few basic but important things that can help write effective Automation Code for any platform.
When we start our Automation Project, we all involve ourselves into various strategies and techniques to test a functionality End to End. We implement Test Execution steps, Data Driven Framework (mostly), Reports, Loggers and what not. To navigate through various screen having data or images, we write predefined wait conditions or we implement complete codes to wait by ourselves. Even though we face few issues like timeout/specified element/screen not found error and etc while waiting for an activity (in android) / screen / UI elements. So, we happen to run and test our code multiple times to ensure that our code works fine and it’s the device or app which is having problem. Finally we let it go and publish our code.
But we always forget or ignore basic OS function/Apps in Device. Here are few tips which will can fix these issues.
- Disable Animation in your Device: In Android, Go to Settings > Developers options and set “Window animation scale”, “Transition animation scale”, “Animator duration scale” to “Off”. In iOS, Go to Settings > General > Accessibility and turn off “Reduce Motion”
- Force Stop / Uninstall any app which uses internet
- Turn off Automatic Sync for your mails / Dropbox or any other apps/widgets
- Close all background apps
- Clear your RAM and have adequate memory available
- Select a good Wifi Connection or use Mobile Network. 4G or 3G is preferable than 2G
- Use an Automation Tool which gives maximum accuracy level. E.g. Robotium for Android (You should also checkout Google’s “Espresso – Android Test Kit”)
Hope this will help you next time when you perform Automation Testing. Please do comment on the post and share your thoughts.