O'Reilly logo

Robotium Automated Testing for Android by Hrushikesh Zadgaonkar

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Hybrid test example

Let's see one hybrid application, that is, the application under test, and create a simple test project to test this application.

The application provides a WebView control in its layout and loads Google's homepage in it (as shown in the following screenshot). You can see the source code of the application before moving onto writing test cases:

Hybrid test example

The source code of the WebViewActivity.java file is as follows:

public class WebViewActivity extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.web_main); WebView webView = (WebView) findViewById(R.id.mainWebView); ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required