In this article, I would describe about how to emulate the various user actions such as doubletap, singletap, flick etc using Selenium in Android Mobile Browser.
Android devices as an inbuild browser called ‘Android Browser’, and Selenium has a separate module that can be used to automate ‘Android Browser’.
Details about how to use ‘Selenium Android Package’ for mobile automation can be found in this link: http://code.google.com/p/selenium/wiki/AndroidDriver
Above web page has the detailed description about how to automate Android using Selenium (ofcourse we need patience during the initial setup, as we would commit some inadvertent mistakes while setting up). So, I would give you a code snippet that performs user actions such as doubletap, singletap,flick using Selenium in this article.
AndroidDriver driver = new AndroidDriver();
WebElement elem = driver.findelement(By.id(“name”));
Action TchAct = new TouchActions(driver).doubleTap(elem).build();
TchAct = new TouchActions(driver).singleTap(elem).build();
TchAct = new TouchActions(driver) .flick(element,0,-400,FlickAction.SPEED_NORMAL).build();
Here we are using ‘Action’ and ‘TouchActions’ classes of Selenium to emulate the user actions. And these actions emulates the user behavior as expected. As mentioned above, Selenium supports other user actions such as longpress, scroll, up, down etc.
Please let me know if you have any clarifications on this article.