如何在Appium iOS中添加同时移动的触摸(如果有';s的持续时间更长?

如何在Appium iOS中添加同时移动的触摸(如果有';s的持续时间更长?,appium,appium-ios,xcuitest,python-appium,Appium,Appium Ios,Xcuitest,Python Appium,我的应用程序中有一个ui视图。它接收UITouch-es,并具有相当复杂的处理逻辑。处理逻辑取决于UIKit触摸界面 我不知道如何用TouchAction或MultiAction重现这种情况。 有两次接触touch2启动较晚,持续时间较短: 在t3和t4触碰同时移动的瞬间,touch2结束,但touch1仍在移动 我当前的非工作代码: 在UIKit中,触摸事件如下所示: touchesBegan: [touch1_t1] touchesBegan: [touch2_t2] touchesMov

我的应用程序中有一个
ui视图
。它接收
UITouch
-es,并具有相当复杂的处理逻辑。处理逻辑取决于UIKit触摸界面

我不知道如何用
TouchAction
MultiAction
重现这种情况。 有两次接触touch2启动较晚,持续时间较短:

t3
t4
触碰同时移动的瞬间,touch2结束,但touch1仍在移动
我当前的非工作代码:

在UIKit中,触摸事件如下所示:

touchesBegan: [touch1_t1]
touchesBegan: [touch2_t2]
touchesMoved: [touch1_t3, touch2_t3]
touchesMoved: [touch1_t4, touch2_t4]
touchesEnded: [touch2_t4]
touchesMoved: [touch1_t5]
touchesEnded: [touch1_t5]
有可能用Appium实现这一点吗

multi-action
能否执行两次非同时触碰

Python Appium客户端中是否有更低级的API,例如Selenium、XCUITest


任何帮助都将不胜感激。

好的。下面是一个在Java中使用手势的示例

PointerInput finger = new PointerInput(PointerInput.Kind.TOUCH, "finger");
Dimension size = driver.manage().window().getSize();
//get your screen size
Point source = new Point(size.getWidth(), size.getHeight());
//this is resolution of your screen 
Sequence pinch = new Sequence(finger, 0);
pinch.addAction(finger.createPointerMove(Duration.ofMillis(0),
                PointerInput.Origin.viewport(), source.x / 2, source.y / 2));
pinch.addAction(finger.createPointerDown(PointerInput.MouseButton.LEFT.asArg()));
pinch.addAction(new Pause(finger, Duration.ofMillis(100)));
pinch.addAction(finger.createPointerMove(Duration.ofMillis(600),
                    PointerInput.Origin.viewport(), source.x / 3, source.y / 3));
然后你需要调用
driver.perform(Arrays.asList(pinchAndZoom1))

正如您所见,您可以修改手势的持续时间,围绕它玩一玩,您就会了解它是如何工作的。还有一些带有示例的文档。

我建议您尝试使用手势而不是多点触控。我只能用Java提供一些示例。如果你对此感兴趣,请告诉我。要使用的库有:
指针输入
序列
。不知道相关的pythonlibraries@Vault23您是指导入org.openqa.selenium.interactions.Sequence的序列吗?@Vault23是的,我也对Java解决方案感兴趣。:)如果您提供一些指向库和示例代码的链接,那就太好了。@OlhaPavliuk在为我的应用程序编写测试时,我也遇到了类似的问题。你能解决这个问题吗?@Vishwas我很抱歉,我推迟了这项工作,因为优先级发生了变化。而我目前的假设是,这个API是在Java Appium客户端中实现的,而不是在Python中实现的。谢谢!我来看看。