Support Center

Your First Steps

Last Updated: Nov 06, 2012 04:51PM CET
 

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 BitbarSampleApp - project which is provided with the Recorder under First Recording.

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 Test is used. Click Next.
     
  4. In the opening menu choose An existing Android project as project to test and then your existing Android project, in this case BitbarSampleApp. 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.
  2. 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. 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.

Contact Us

support@bitbar.com
http://assets2.desk.com/
false
bitbar
Loading
seconds ago
a minute ago
minutes ago
an hour ago
hours ago
a day ago
days ago
about
false
Invalid characters found
/customer/en/portal/articles/autocomplete