
- Espresso Testing Framework Tutorial
- Espresso Testing - Home
- Introduction
- Setup Instructions
- Running Tests In Android Studio
- Overview of JUnit
- Architecture
- View Matchers
- Custom View Matchers
- View Assertions
- View Actions
- Testing AdapterView
- Testing WebView
- Testing Asynchronous Operations
- Testing Intents
- Testing UI for Multiple Application
- Test Recorder
- Testing UI Performance
- Testing Accessibility
- Espresso Testing Resources
- Espresso Testing - Quick Guide
- Espresso Testing - Useful Resources
- Espresso Testing - Discussion
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Espresso Testing Framework - UI Performance
Positive User experience plays a very important role in the success of an application. User experience not only involves beautiful user interfaces but also how fast those beautiful user interfaces are rendered and what is the frame per second rate. User interface needs to run consistently at 60 frames per second to give good user experience.
Let us learn some of the option available in the android to analyze UI performance in this chapter.
dumpsys
dumpsys is an in-built tool available in the android device. It outputs current information about the system services. dumpsys has the option to dump information about particular category. Passing gfxinfo will provide animation information of the supplied package. The command is as follows,
> adb shell dumpsys gfxinfo <PACKAGE_NAME>
framestats
framestats is an option of the dumpsys command. Once dumpsys is invoked with framestats, it will dump detailed frame timing information of recent frames. The command is as follows,
> adb shell dumpsys gfxinfo <PACKAGE_NAME> framestats
It outputs the information as CSV (comma separated values). The output in CSV format helps to easily push the data into excel and subsequently extract useful information through excel formulas and charts.
systrace
systrace is also an in-build tool available in the android device. It captures and displays execution times of the application processes. systrace can be run using the below command in the android studio’s terminal,
python %ANDROID_HOME%/platform-tools/systrace/systrace.py --time=10 -o my_trace_output.html gfx view res