Sign in

In this post I will describe how to use RunListener in Android instrumented tests (i.e. UI Automator or Espresso). But before getting into the nitty-gritty details, let’s discuss if you need to use it at all.

First let me explain why I started looking into RunListener. Our test framework, based on UiAutomator and JUnit4, was taking screenshots in TestWatcher::failed() method, but was performing cleanup in teardown() method annotated with @After. The problem was that other actions performed in teardown() would often change the current activity, and thus any screenshot taken after that would would be useless. The simplest solution was…


Those of us who work in a team often have to use some git-based repository for managing automation source code. In this post I would like to share with you git commands I use most often for my everyday tasks, and hopefully you will find them useful.

Updating local repository

  • git pull – pull down the latest data from the remote repository.
  • git pull --recurse-submodules – same as above, but updates submodules as well.
  • git pull --rebase origin master – update current local branch against the most recent master on remote. You may need to resolve merge conflicts. …

Today I would like to share with you brief reviews of two test automation books I’ve recently read — “Software Testing Automation Tips: 50 Things Automation Engineers Should Know” and “Mastering Mobile Test Automation”.

“Software Testing Automation Tips: 50 Things Automation Engineers Should Know” by Gennadiy Alpaev, 2017

This is book is a list of tips for test automation engineers, and I’m happy to say that the tips are solid and are written in a brief, concise manner. Another good thing about this book is that it is tool- or language-agnostic…


This is a list of adb commands which I often use when doing manual or automated testing of Android apps.

Those unfamiliar with adb can read about it and find installation instructions here. In short, adb is a command-line tools which allows communication with Android device via USB or Wi-Fi and execution of variety of the commands on the device. It is really useful when testing apps on Android, whether manually or via automation.

If used on Windows, it is convenient to install GNU utils for Windows in order to be able to use tools like grep, sed or awk…


When doing mobile test automation, it might be necessary to check if a certain notification is displayed in a status bar. In this post I’m going to describe how this can be achieved on Android using adb and/or UiAutomator. Some of the approaches can also be used with Appium.

1. Use GUI automation

In order to get displayed notifications using GUI, open the notification drawer with UiDevice.openNotification() method, get the list UIObject by id(“com.android.systemui:id/notification_stack_scroll” or “com.android.systemui:id/scroll” in Lollipop and below) and then search for the desired notification by its text. …


Note: This is Part 2 of a two-part series on most common test automation mistakes. Part 1 is here.

Here is my take on the “most common test automation mistakes” topic. However, I’m not going to delve into the mistakes in setting up the automation strategy or using Selenium etc. Instead, I’m going to concentrate on mistakes on a coding level applicable to many testing tools, frameworks and programming languages (I will use Java and JUnit4 in my examples, though).

6) “Hacks” with no explanation

Consider the following piece of code:

void enableLogging() {
loggingCheckbox.enable();
loggingCheckbox.disable();
loggingCheckbox.enable();
}

Is this…


This is my take on the “most common test automation mistakes” topic. However, I’m not going to delve into the mistakes SDETs make when creating test automation strategy or using Selenium etc. Instead, I’m going to concentrate on mistakes on a coding level, which are relevant to many testing tools, frameworks and programming languages (I will use Java and JUnit4 in my examples, though).

So, here is my top.

  1. No error messages in assertions.
assertTrue(isOrderCompleted());

Without error message the reader of the test report will not be able to see why the test failed and they will have to look…


In this post I’m going to explain step-by-step how to create Android background service which runs multiple concurrent threads.

  1. First we need to create service class (File->New->Service->Service). It is better to remove all boilerplate code inside the created class.
  2. Then we need to add the created service in the manifest file (AndroidManifest.xml). Set “android:exported” attribute to “false” if the service doesn’t need to be accessible to other apps.

3. Declare ThreadPoolExecutor executor member variable which we will be sending our tasks to and instantiate it in onCreate().

4. Now in onStartCommand() we can start executing our tasks:

rokuoku

Test automation engineer based in Tokyo.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store