TUTORIAL: Your first steps

 

Before we start

This will show you how to record your first test with Testdroid Recorder. We assume that you have an Android project opened in Eclipse with installed Testdroid Recorder Plugin. If you haven’t installed the plugin yet follow the Installation tutorial. In this example we are using ApiDemos-project which is an Android demo project.

How to create tests:

  1. First, ensure that the project you need to test runs fine by Run as -> Android Application. It should start on your device or emulator.
  2. Check that the device you want to use to record the test is connected to your computer or the system you are using to run the test. Alternatively, you can run the tests on a virtual device.
  3. Create a new Android test project: File -> New -> Other -> Android -> Android Test Project. Give project name for this test project. In this example ApiDemosTest is used. Click Next.
  4. Select existing ApiDemos-project from the list.
  5. In the opening menu choose An existing Android project as project to test and then your existing Android project, in this case ApiDemos. Usually you don’t need to change anything else here. Click Finish and the test project is ready.

Pic 1. A new Android Test Project

  1. Select the test package, click the right mouse button and choose New -> Other.
Pic 2. Other...
  1. In the new menu window select Android – Testdroid -> New Robotium Test. Click Next.
Pic 3. New Robotium Test
  1. If authorization window is shown, insert your Testdroid Cloud credentials to authorize and press Authorize.
Pic 4. Authorization
  1. Check the details and change them if necessary. Click Next.
Pic 5. Test project details
  1. Press Record button. Now the wizard is launching your application project to your device or emulator, and when you see Recording started comment appear on the screen, you’re ready to go! Just use your application in the way you want it to be tested and the generated code is shown on the screen.

Pic 6. Recording

  1. When you are finished, simply click Stop and Finish on the menu screen at Eclipse. The wizard takes care of creating a new test class for you, installing Robotium library and adding it to your Java build path.

Pic 7. The Robotium library is automatically included

The Robotium library is automatically included.
  1. To run your newly created test in Eclipse, use Run As -> Android JUnit Test. You should see your application being tested and the JUnit view shows results.
Pic 8. The successful test

The successful test.

Next steps

In this example we recorded Robotium tests using project sources. You do not have to have application sources to be able to record test – it is possible to record tests using APK file. See our From source or from APK tutorial to see the benefits of both methods.

We recommend that you build test cases that consist of many smaller parts, rather than one huge monolithic test case. Smaller units are easier to handle and it is easier to find out why the test has failed. Also the tests is easier to manage during the development, when the application goes through significant changes. Visit Advanced recording tutorial to learn, how to record better tests.

Next on tutorials:
  1. From source or from APK?
Read our blog
18.05.2012

Before we start, please download the latest version of Testdroid Recorder and install it in Eclipse. Here you will find [...]

16.05.2012

May 15th, 2012 by Bitbar Woot! The Testdroid team just received an invitation from Google Android Developer Advocates team to play [...]

We make your app testing easier:
follow
Company info

Bitbar is a technology and services company with ambition to help its customers to get most of their R&D by offering high-performance automated software Build and Test solutions. Our solutions are ideal for development teams that want to deliver high quality software without the hassle of developing, building and maintaining own tools for Android testing. We are accelerating time to market and lowering costs of developing software on Android platform, be it on smartphones, tablet computers or TVs.


Bitbar is a technology and services company with ambition to help its customers to get most of their R&D by offering high-performance automated software Build and Test solutions. Our solutions are ideal for development teams that want to deliver high quality software without the hassle of developing, building and maintaining own tools for Android testing. We are accelerating time to market and lowering costs of developing software on Android platform, be it on smartphones, tablet computers or TVs.


Bitbar is a technology and services company with ambition to help its customers to get most of their R&D by offering high-performance automated software Build and Test solutions. Our solutions are ideal for development teams that want to deliver high quality software without the hassle of developing, building and maintaining own tools for Android testing. We are accelerating time to market and lowering costs of developing software on Android platform, be it on smartphones, tablet computers or TVs.


Copyrights to Bitbar info@bitbar.com