提问人:User1751 提问时间:11/7/2023 更新时间:11/7/2023 访问量:31
在使用 Appium Java 客户端和 Selenium 的 iOS 17 上,PointerInput 的输入行为不一致
Inconsistent Input Behavior with PointerInput on iOS 17 using Appium Java Client and Selenium
问:
我目前正在使用 iOS 17 和 Appium Java 客户端版本 8.5.0。我的目标是通过使用 PointerInput 类模拟按键,在数字字段中输入三个数字。
场景如下:我尝试使用键盘单击数字 1、2 和 3,它们对应于屏幕上的以下坐标:
数字 1:按钮位于位置 (0,561) 数字 2:位置按钮 (125,561) 数字 3:位置的按钮 (262,561) 但是,我遇到了不一致的输入行为。我得到的输出不是获得预期的“123”序列,而是“11122”。尽管已经尝试了输入之间的停顿的不同持续时间,但这种情况还是发生了。
无论我如何调整暂停,似乎都没有改善,并且输入不稳定并且包含的数字比预期多,问题仍然存在。目前尚不清楚问题是否出在 PointerInput 实现上,或者是否有我没有考虑的特定 iOS 17 交互。
public void fasterPINLogin(String numbersText) {
PointerInput finger = new PointerInput(PointerInput.Kind.TOUCH, "finger");
Sequence tap = new Sequence(finger, 0);
if (isIOS()) {
clicks(finger, tap,0,561);
clicks(finger, tap,128,561);
clicks(finger, tap,262,561);
iosDriver.perform(List.of(tap));
}
}
private void clicks(PointerInput finger, Sequence tap, int x, int y) {
tap.addAction(finger.createPointerMove(ofMillis(10),
PointerInput.Origin.viewport(), x, y));
tap.addAction(finger.createPointerDown(LEFT.asArg()));
tap.addAction(new Pause(finger, ofMillis(500)));
tap.addAction(finger.createPointerUp(LEFT.asArg()));
tap.addAction(new Pause(finger, ofMillis(500)));
}`
答: 暂无答案
评论