ExecuteAutomation

Writing simple testcase for Hybrid application using Robotium (Series)

In this part we will start to write test case for the Hybrid application we developed in previous post of this series The complete code is shown below
public class GoogleSearchTC extends ActivityInstrumentationTestCase2 {

	
	Solo solo;
	
	public GoogleSearchTC() {
		super(EAActivity.class);
		// TODO Auto-generated constructor stub
	}

	protected void setUp() throws Exception {
		solo = new Solo(getInstrumentation(), getActivity());
	}
	
	public void testGoogle()
	{
		
		//Get the applications webview
		WebView view = (WebView) solo.getView(R.id.webviewMain);
		
		solo.waitForView(view, 3000, false);
		
		WebElement txtSearch = solo.getWebElement(By.name("q"), 0);
		solo.typeTextInWebElement(txtSearch, "Execute Automation");
		
		WebElement btnSearch = solo.getWebElement(By.name("btnG"), 0);
		solo.clickOnWebElement(btnSearch);

	}
	

}
Please find below the complete video of the above discussion Thanks for reading the post and watching the video !!! Please leave your comments and let me know if there is anything I should update in this post. Thanks, Karthik KK