Android | Robotium: Get Android Version and Device Details Programmatically

While working with Android we might face some situations where we have to write device specific code. e.g Some code goes if running on Emulator and Some other code goes if running on Real device. This is very much useful while working with Test automation framework : Robotium While developing test scripts to specify some […]

Robotium : Run test scripts on a remote device.

    We have posted about running test scripts directly from Jenkins by introducing use of  android-maven-plugin here. Now we must be able to run test scripts on a VM or Cloud VM using Jenkins on Emulators. But sometimes we need to run scripts on a real device connected to PC , that seems not […]

Robotium : Run Test Scripts Directly From Mobile Device , Way To Run Shell scripts On Mobile Device

  People using Robotium to automate android application testing must be running scripts on an Emulator or On a device using Eclipse or ADT. But some scenarios demand to be able to run scripts on the device independently where purpose may be Convenience or some issues regarding the use of the AUT. Steps: 1. Install […]

Robotium : Some Useful functionalities and Methods To Make Automation Scripts More Robust

1. Targeting Tabs In The Application Example Case Study: Suppose We have three tabs in a Screen/Activity in the application. named Tab1 , Tab2 , And Tab3. And we want to navigate to Tab2 or Tab3 as by default the application launches Tab1. In this case we can manage by writing scripts like solo.clickOnText(“Tab2”); But […]

Robotium Integration with Jenkins

            Robotium Android Testing Platform can be integrated with Jenkins which makes Mobile Automation a step forward . Step By Step Instructions For Integration with Jenkins: Step 1: Deploy Jenkins in server. Download Jenkins from the website : http://jenkins-ci.org/.  Download the war build of Jenkins and deploy it in the server […]

Android Robotium : Make Wi-Fi and Mobile Data Network Enable & Disable Programatically

While working with android application development or automating test scripts for android application testing sometimes we need to ON/OFF Wi-Fi and Mobile Data Access feature explicitly. Android library facilitates to do that in the following way: For Wi-Fi: WifiManager wifiman=(WifiManager)solo.getCurrentActivity().getSystemService(Context.WIFI_SERVICE); wifiman.setWifiEnabled(false); Passing false will disable Wi-Fi and true enables it. For Mobile Data: ConnectivityManager dataManager=(ConnectivityManager)solo.getCurrentActivity().getSystemService(Context.CONNECTIVITY_SERVICE); Method dataMtd […]

Robotium : Android JUnit test annotations

Annotations Available With Android JUnit Test: Deprecated Annotation type used to mark program elements that should no longer be used by programmers. Documented Defines a meta-annotation for indicating that an annotation is documented and considered part of the public API. FlakyTest This annotation can be used on an InstrumentationTestCase‘s test methods. Inherited Defines a meta-annotation […]

Robotium : Assert Text Containing Special Characters In Android Application While using solo.waitForText() and solo.searchText()

Robotium Provides some functions to assert texts that is reflected on the screen as a part of it or as a toast message. But the problem arises when Text contains some special characters in it. Assertion fails for verifying special characters in the Text. For Example : Suppose we want to verify Text : “Password(s) […]

Android : How to test if Android Application has memory leaks

Manual Front: Application slowing down while using it? It gets unresponsive after a while of use? It gets a significant amount of time to load an activity? Automation Front: Instrumentation/Robotium test fails after a number of test methods getting executed? Automation fails on its way throwing Out Of Memory exception? Yes , Symptoms indicate you to investigate […]

Android Automation : How to inspect WebViews and get locators

There are several ways to inspect and build locators of native components in  android application – That can be used with a number of android automation tools . e.g Robotium , Appium etc.  UIAutomatorviewer, Hierarchyviewer to name a few. When question comes about WebViews , we have a limited number of options. So here a Step by step […]