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:
- First, ensure that the project you need to test runs fine by Run as -> Android Application. It should start on your device or emulator.
- 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.
- 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.
- Select existing ApiDemos-project from the list.
- 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.
- Select the test package, click the right mouse button and choose New -> Other.
- In the new menu window select Android – Testdroid -> New Robotium Test. Click Next.
- If authorization window is shown, insert your Testdroid Cloud credentials to authorize and press Authorize.
- Check the details and change them if necessary. Click Next.
- 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.
- 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.
- 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.
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.
Before we start, please download the latest version of Testdroid Recorder and install it in Eclipse. Here you will find [...]
May 15th, 2012 by Bitbar Woot! The Testdroid team just received an invitation from Google Android Developer Advocates team to play [...]
- Android's mktshare jumped 20%-points to 56%, iPhones just 6%-points from Q1/11 to Q1/12 http://t.co/v7MXpsXf
18.05.2012 - RT @FredLardieg: Great post from @chrisvelazco about Android fragmentation: http://t.co/4iqGtOjI. Check out Testdroid http://t.co/iWUJM6ei to fix the problem
17.05.2012 - Come and see a live demo on testing your app automatically on 100+ real devices on booth 405 #AnDevCon #Testdroid
16.05.2012







