Zoom - Multi Touch Action not working. Only one action is getting performed | Appium Forum
K
Keerthi Posted on 06/08/2019

 

int startx= (int) (image.getLocation().getX())+(image.getSize().getWidth()/2);
int starty= (int) (image.getLocation().getY())+(image.getSize().getHeight()/2);

System.out.println("startx center point"+startx);
System.out.println("starty center point"+starty);


TouchAction zoomin=new TouchAction(driver);
zoomin.press(point(startx,starty+10)).waitAction(WaitOptions.waitOptions(Duration.ofSeconds(1))).moveTo(point(startx,starty+200)).release();

//Thread.sleep(2000);

TouchAction zoomOut = new TouchAction(driver);
zoomOut.press(point(startx,starty-10)).waitAction(WaitOptions.waitOptions(Duration.ofSeconds(1))).moveTo(point(startx,starty-200)).release();

MultiTouchAction act1=new MultiTouchAction(driver);
act1.add(zoomin).add(zoomOut).perform();

Only one action is getting performed.Can you please help


K
Keerthi Replied on 07/08/2019

Can you please share the code for zooming.I dont see the videos for swiping,tapping for android version higher than 6.0.

Please respond.


A
aditya Replied on 10/08/2019

For zoom, you need to use 2 TouchAction classes and then pour the result in Multi-Touch action class.

please let me know if you need any other help


K
Keerthi Replied on 13/08/2019

I resolved the zoom issue  but I couldnt find videos for swipe,tap,Key Events.Can you lease add them.


K
Keerthi Replied on 13/08/2019

Can you please share the code for double tap.


A
aditya Replied on 22/08/2019

You mean multi touch events..

You just need to add two Touch events and add them in multi touch. Please let me know if you need additional help