Mobile Automation Testing URL Notes
Speeding up Test Execution with Appium
https://www.thoughtworks.com/insights/blog/speeding-test-execution-appium
Use SeleniumGrid can start multiple Appium server with different ports.
The goal is to execute automation testing in multiple devices with distribute or parallel.
Roadmap
1. Implement parallel run at method level. Currently, when the execution mode is set to Distribute, the tests are distributed at class level to the devices. In future, the scope is to distribute tests at method level.
2. Implement parallel run for iOS real devices for Native,Hybrid and Web apps. Current scope is to run tests in parallel across Android devices. The same implementation will be added to iOS real devices.
3. Implement ScreenCast as attachment for Android tests. Current scope is to attach a screenshot on failure to the reports, with future improvements to include adding screen-recording as well for test failures
4. Image Comparison for UI Verification(using ImageMagick API). Add visual assertions to compare two images and validate
The framework does generate detailed HTML reports (using Extent API) which includes AppiumServerLogs and ADBLogs. For test failures, it includes screenshots.
Project links
• Take a look @ the repo AppiumTestDistribution
• Sample Test Project GitHub link to the sample example
Reference links
• Extent Reports
•
• WordPress Android App
• How appium works for Android and iOS
• Setup of Appium on OSX and Windows
Android Developer Helper Web Site
Android developer web site is great and helpful web site. You can get most of information from it.
Command Line Tools
The Android SDK tools available from the SDK Manager provide additional command-line tools to help you during your Android development. The tools are classified into two groups: SDK tools and platform tools. SDK tools are platform independent and are required no matter which Android platform you are developing on. Platform tools are customized to support the features of the latest Android platform.
Content Providers
Content providers manage access to a structured set of data. They encapsulate the data, and provide mechanisms for defining data security. Content providers are the standard interface that connects data in one process with code running in another process.s
https://developer.android.com/guide/topics/providers/content-providers.html
Test Your App
Android Studio is designed to make testing simple. With just a few clicks, you can set up a JUnit test that runs on the local JVM or an instrumented test that runs on a device. Of course, you can also extend your test capabilities by integrating test frameworks such as Mockito to test Android API calls in your local unit tests, and Espresso or UI Automator to exercise user interaction in your instrumented tests. You can generate Espresso tests automatically using Espresso Test Recorder.
https://developer.android.com/studio/test/index.html
Intent
An intent is an abstract description of an operation to be performed. It can be used with startActivity to launch an Activity,broadcastIntent to send it to any interested BroadcastReceiver components, and startService(Intent) orbindService(Intent, ServiceConnection, int) to communicate with a background Service.
An Intent provides a facility for performing late runtime binding between the code in different applications. Its most significant use is in the launching of activities, where it can be thought of as the glue between activities. It is basically a passive data structure holding an abstract description of an action to be performed.
https://developer.android.com/reference/android/content/Intent.html
monkeyrunner
The monkeyrunner tool provides an API for writing programs that control an Android device or emulator from outside of Android code. With monkeyrunner, you can write a Python program that installs an Android application or test package, runs it, sends keystrokes to it, takes screenshots of its user interface, and stores screenshots on the workstation. The monkeyrunner tool is primarily designed to test applications and devices at the functional/framework level and for running unit test suites, but you are free to use it for other purposes.
https://developer.android.com/studio/test/monkeyrunner/index.html
ADB Shell Commands
The Android Debug Bridge (adb) provides a Unix shell that you can use to run a variety of commands on an emulator or connected device. The command binaries are stored in the file system of the emulator or device, at /system/bin/…
https://developer.android.com/studio/command-line/shell.html#shellcommands