[Android General] Ravi H Basawa:
Presents

Table of Contents:

1.	Robotium

2.	What all we need before we get it started?

3.	How to setup Robotium using Eclipse ADT with source code of Android Application?

3a. Basic Android Test Project with source code

4.	How to setup Robotium using Eclipse ADT without source code of Android Application?

4a. Basic Android Test Project without source code

5.	What is JUnit Test Suite and why we need it with Robotium?

6.	How to Data-Drive Robotium Scripts?

7.	Issues or challenges with Robotium

Please skip to second post If you are reading this post for the first time​

ROBOTIUM 5.2.1 Released​

New Features and bug Fix details:​

unlockScreen() - Unlocks the screen lock.

getCurrentViews(Class<T> classToFilterBy, boolean includeSubclasses) - New parameter includeSubclasses set to true if also subclasses should be returned.

scrollToSide(Side side, float scrollPosition, int stepCount) - Added parameter stepCount to allow for users to decide the speed of the scroll.

scrollViewToSide(View view, Side side, float scrollPosition, int stepCount) - Added parameter stepCount to allow for users to decide the speed of the scroll.

Bugs fixed:

Issue-600 - ViewFetcher, getRecentDecorView fails on Samsung S4 with MultiWindow support

Issue-579 - Screenshots do not get saved

Issue-589 - waitForFragment on vers < 3.0

Issue-615 - ScrollToSide opens the navigation bar

I hope you will enjoy this release!

Link To Download:

CLICK HERE

Robotium Recorder 2.0 is released!

From,

Renas Reda

Founder and CEO at Robotium Tech

We're excited to announce the release of Robotium Recorder 2.0. Thanks to all the feedback that we've received, we've been able to make hundreds of improvements since it first launched. It's now compatible with more apps and is optimized to generate even smarter tests than before.

New in Robotium Recorder 2.0:

- Improved click and gesture support.

- Click to Assert™ has been further refined and is now performing optimally in a broad range of apps.

- Record click and drag coordinates by selecting the option in "Settings".

- Full support for GL apps and games by enabling touch and drag coordinates.

- After a test case has been saved it can now be executed directly from Robotium Recorder by clicking "Run Test".

Robotium Recorder 2.0 comes with a new trial period, so even if you have consumed the trial of the old version you are now able to try this new version as well.

To update Robotium Recorder, in Eclipse go to Help --> "Check for updates"

Details on how to install explained in the Old posts below.​

````````````````````````````````````````````````````````````````````````````````````````````````````` ````````````````````````````````````````````````````

OLD POSTS

:victory:ROBOTIUM 5.0.1 Got Released !!! :victory:

Robotium Rec. Latest Update: 1.4.11 (23/01/14)

Renas Reda

Founder and maintainer of Robotium

said,

The new changes in 5.0.1 are as follows,

NOTE:

The package name has been changed to com.robotium.solo. You’ll need to update the import line at the top of your current test classes from com.jayway.android.solo to com.robotium.solo.

New functionality in Robotium 5.0.1:

pressSoftKeyboardNextButton() - Presses the next button on the soft keyboard.

waitForEmptyActivityStack(int timeout) - Waits until the Activity stack is empty.

New Class com.robotium.solo.Solo.Config:

int timeout_large - The timeout length of the waitFor methods. Default length is 20 000 milliseconds.

int timeout_small - The timeout length of the get, is, set, assert, enter and click methods. Default length is 10 000 milliseconds.

String screenshotSavePath - The screenshot save path. Default save path is /sdcard/Robotium-Screenshots/.

ScreenshotFileType screenshotFileType - The screenshot file type, JPEG or PNG. Use ScreenshotFileType.JPEG or ScreenshotFileType.PNG. Default file type is JPEG.

boolean shouldScroll - Set to true if the get, is, set, enter, type and click methods should scroll. Default value is true.

boolean useJavaScriptToClickWebElements - Set to true if JavaScript should be used to click WebElements. Default value is false.

Improvements:

All the click methods. Improved behaviour in unfavorable situations.

The waitForDialogToOpen & waitForDialogToClose methods. Now recognises all dialogs.

The internal View handling class.

TakeScreenshot() now supports GLSurfaceViews with OpenGL ES 3.0.

See the Javadoc for an example on how to use the new Config class.

We hope you will enjoy this release!

https://code.google.com/p/robotium/downloads/list

User Guide for Robotium Recorder

( Skip this guide if you are reading this post for the first time and move on with the second post..)

Link to Robotium Official website: Click Here

Prerequisites:

Install Robotium Recorder, if not already installed.

Connect a device (recommended) or start an emulator with external storage.

Start Robotium Recorder

Start Robotium Recorder from the toolbar: Eclipse > New > Other > Android - Robotium Recorder.

Robotium Recorder can also be started by right clicking an existing app or test project and from the opened menu select: Robotium Recorder > New Robotium Test.

Record test cases from a workspace project

From Robotium Recorder it's possible to select either a binary (APK file) or a workspace project to record test cases from. In the screenshot below a workspace project has been selected. Enter a test project name and click "Next".

Record test cases from a binary APK

To record test cases from an APK, click "select apk". A file browser will be opened where the APK can be selected. Robotium Recorder will automatically sign the APK with the local debug certificate.

Once the signing process has finished the "Next" button will be enabled.

Start recording

Clicking Next on the previous screen will show the recording screen.

In the left bottom corner there is Setting menu with three options:

a. Use sleeps - choose if sleeps should be used to playback test cases in the same speed as they were recorded. Can be useful for slower apps like bandwidth intensive or hybrid apps.

b. Keep app data - choose if app data is to be kept when starting a new recording session.

c. Identify class over string - default View identifier is always the resource ID. In the event a resource ID is missing it's possible to choose if a View class identifier is to be used over a string identifier (the text displayed by the View).

Click "New Robotium Test".

If an APK is selected, Robotium Recorder will first install the re-signed APK on the device or emulator.

When installation of the workspace project or APK is done the recording will be started.

The app is executed on the device or emulator and recording of user actions starts.

The recorded steps are shown in the test step table (as seen below)

If a test step is selected in the table the "Delete step" and "Take screenshot" buttons will be enabled.

1. Select any step in the table and click on "Delete step" to delete it.

2. Click "Take screenshot" to add a screenshot step after the selected step.

To stop the recording click "Stop Recording".

To save the test case click "Save", enter a test case name, and click "Ok".

If the test project already exists it will save the test case in that project. Otherwise it will first create the test project and then save the test case. Either start a new recording or close Robotium Recorder by clicking "Finish".

To see the saved test case(s) expand the test project and look in the src folder. The whole test project or a specific test case can be executed by right clicking it and selecting Run As > Android JUnit Test.

​

Credits,

My Parents - For the best support.

[MENTION=5653911]Swaroop Bandagadde[/MENTION] - For the best support.

Renas Reda(Founder of Robotium Test Automation Tool) - For liking my tutorial and for the best support.

My Other Works:

1. SELENIUM TEST AUTOMATION TOOL

2. MONKEYRUNNER TEST AUTOMATION TOOL