Appium & Java : how to perform fast click actions?

Hi All,
I would like to perform 10 quick clicks action on a button in an Android app (prefer 0.5s), but following 10 clicks’ gap is too long (approx 1.5 sec gap). Wondering what is the proper way to shorten the gap between each click in Appium Java?
I’ve tried findElement by xpath, but still no luck, wondering if there’s any other way? or it’s just simply the limitation of Appium for now? (btw i’m using io.appium 6.0.0-BETA4)
THANK YOU in advance!

MobileElement element = driver.findElement(“btnA”));
for(int i=1; i<11; i++) {;

Why do you want to do 10 taps in quick succession ? Is this valid user story at all ?

Till date didn’t come across any app which needs such actions :grinning:

Thanks for your reply, it’s a valid user story for my case, and it would be great if anyone could give me some idea how to do it. THANK YOU!

@yitelu last time i needed similar i used following approach.

  • tap by element IS slow thus use tap by X, Y!
  1. find element
  2. get is center x,y
  3. now tap 10 times using x,y - it is times faster then by element (which involves element search first)

Hi @Aleksei ,
Thanks for your reply. it seems that TouchAction tap is deprecated, wondering if you know other method? or wondering if you could share how to implement it?

here’s my code attempts:

WebElement webElement = driver.findElement(By.xpath("//android.widget.TextView[@index=‘1’]"));
int startX=webElement.getLocation().getX();
int startY=webElement.getLocation().getY();

 TouchAction action = new TouchAction(driver);

 for(int i=1; i<11; i++){
             action.tap(startX, startY);

@yitelu check ->

and look at MultiTouchAction!

1 Like

Awesome! that’s exactly what i needed! thanks

I also needed to tap on a textView 10 times for a use case and tried both the TouchAction & MultiTouchAction with the below code.

Solution 1: Using TouchAction class

	TouchAction action = new TouchAction(driver);
	int startX=mobEl.getLocation().getX();
	int startY=mobEl.getLocation().getY();
	for(int i=1; i<11; i++){

Solution 2: Using MultiTouchAction class

MultiTouchAction multiTouch = new MultiTouchAction(driver);
int startX=mobEl.getLocation().getX();
int startY=mobEl.getLocation().getY();
	 for (int i = 0; i < 10; i++) {
	     TouchAction tap = new TouchAction(driver);
	     multiTouch.add(, startY)).waitAction(WaitOptions.waitOptions(Duration.ofMillis(400))).release());


Solution 1 worked for me on Android.

@Aleksei The solution 1 you see above works on my Android but it does not work on iOS.
The script finds elements and taps on it but no feedback from the app. Do you have any idea?

another examples ->

Try mobile: tapWithNumberOfTaps on iOS:

1 Like

@mykola-mokhnach Thank you so much. Really appreciate it. That worked for me.
@Aleksei Thank you as well for the help.

So here is the complete solution for Android and iOS.

	public void multiTap(AppiumDriver<?> driver, MobileElement mobEl, int numberOfTimes) { //Performs multitap

	if(driver instanceof AndroidDriver){
		TouchAction action = new TouchAction(driver);
		int startX=mobEl.getLocation().getX();
		int startY=mobEl.getLocation().getY();
		for(int i=1; i<=numberOfTimes; i++){
	}else if(driver instanceof IOSDriver) {
		JavascriptExecutor js = (JavascriptExecutor) driver;
		Map<String, Object> params = new HashMap<>();
		params.put("numberOfTaps", numberOfTimes);
		params.put("element", mobEl.getId());
		js.executeScript("mobile: tapWithNumberOfTaps", params);