I would recommend you take a look at AndroidDriver for selenium. This is apparently a simple approach to easily testing WebApplications using the Android testing platform.
To check HTTP / HTTP sites, you should use Activity, which includes WebView. The driver was associated with this activity:
WebDriver driver = new AndroidWebDriver(getActivity());
Here is a test example from the link above:
public void testGoogleWorks() // Loads www.google.com driver.get("http://www.google.com"); // Lookup the search box on the page by it HTML name property WebElement searchBox = driver.findElement(By.name("q")); // Enter keys in the search box searchBox.sendKeys("Android Rocks!"); // Hit enter searchBox.submit(); // Ensure the title contains "Google" assertTrue(driver.getTitle().contains("Google")); // Ensure that there is at least one link with the keyword "Android" assertTrue(driver.findElements(By.partialLinkText("Android")).size() > 1); }
Matthew
source share