Appium v2.5.1
[email protected]
Appium-Python-Client==2.11.1
Hi, how do I perform a three finger tap with appium? I want to perform the three finger tap 3 times.
My current code looks like this:
# Set up coordinates for the taps if needed, or find an element to tap on
x1, y1 = 850, 450 # Coordinates for first finger
x2, y2 = 900, 450 # Coordinates for second finger
x3, y3 = 950, 450 # Coordinates for third finger
# Create TouchAction instances for each tap
tap1 = TouchAction(self.driver).tap(x=x1, y=y1)
tap2 = TouchAction(self.driver).tap(x=x2, y=y2)
tap3 = TouchAction(self.driver).tap(x=x3, y=y3)
# Create a MultiAction object
multi_touch = MultiAction(self.driver)
multi_touch.add(tap1, tap2, tap3)
# Perform the multi-touch action (the triple tap)
multi_touch.perform()
multi_touch.perform()
multi_touch.perform()
However, I’m encountering this error:
E Stacktrace:
E io.appium.uiautomator2.common.exceptions.UiAutomator2Exception: Cannot invoke method public boolean androidx.test.uiautomator.InteractionController.performMultiPointerGesture(android.view.MotionEvent$PointerCoords[][]) on object androidx.test.uiautomator.InteractionController@f87e653 with parameters [[[Landroid.view.MotionEvent$PointerCoords;@97eb642]
E at io.appium.uiautomator2.utils.ReflectionUtils.invoke(ReflectionUtils.java:85)
E at io.appium.uiautomator2.core.InteractionController.doPerformMultiPointerGesture(InteractionController.java:127)
E at io.appium.uiautomator2.core.InteractionController.access$400(InteractionController.java:29)
E at io.appium.uiautomator2.core.InteractionController$5.run(InteractionController.java:142)
E at android.app.UiAutomation.executeAndWaitForEvent(UiAutomation.java:920)
E at io.appium.uiautomator2.core.EventRegister.runAndRegisterScrollEvents(EventRegister.java:40)
E at io.appium.uiautomator2.core.EventRegister.runAndRegisterScrollEvents(EventRegister.java:81)
E at io.appium.uiautomator2.core.InteractionController.performMultiPointerGesture(InteractionController.java:139)
E at io.appium.uiautomator2.handler.MultiPointerGesture.safeHandle(MultiPointerGesture.java:44)
E at io.appium.uiautomator2.handler.request.SafeRequestHandler.handle(SafeRequestHandler.java:59)
E at io.appium.uiautomator2.server.AppiumServlet.handleRequest(AppiumServlet.java:277)
E at io.appium.uiautomator2.server.AppiumServlet.handleHttpRequest(AppiumServlet.java:271)
E at io.appium.uiautomator2.http.ServerHandler.channelRead(ServerHandler.java:68)
E at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366)
E at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:352)
E at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:345)
E at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102)
E at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366)
E at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:352)
E at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:345)
E at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:435)
E at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:293)
E at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:267)
E at io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:250)
E at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366)
E at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:352)
E at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:345)
E at io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:266)
E at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366)
E at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:352)
E at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:345)
E at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1294)
E at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366)
E at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:352)
E at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:911)
E at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:131)
E at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:611)
E at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:552)
E at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:466)
E at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:438)
E at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:140)
E at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:144)
E at java.lang.Thread.run(Thread.java:1012)
E Caused by: java.lang.reflect.InvocationTargetException
E at java.lang.reflect.Method.invoke(Native Method)
E at io.appium.uiautomator2.utils.ReflectionUtils.invoke(ReflectionUtils.java:83)
E ... 42 more
E Caused by: java.lang.IllegalArgumentException: Must provide coordinates for at least 2 pointers
E at androidx.test.uiautomator.InteractionController.performMultiPointerGesture(InteractionController.java:724)```