gpt4 book ai didi

javascript - Appium - 滚动到一个不起作用的按钮

转载 作者:太空狗 更新时间:2023-10-29 13:04:02 24 4
gpt4 key购买 nike

所以我一直在尝试向下滚动到我的 Android 应用程序(使用 Kony Visualiser 制作)上的提交按钮,但由于某种原因似乎没有任何效果。到目前为止,我已经尝试过:

  • touchPerformtouchActionfindElementbyAndroidUiAutomator,将longPress改为press,添加wait 操作,反转 x 和 y 数字,更改值和我在网上看到的其他一些建议。

Appium 版本:v1.8.0

我当前的 JavaScript 代码在我滚动浏览其他元素(段)时有效,但仅在我尝试向下滚动可滚动 flexbox 的这种特定情况下无效。

这是我当前代码的一个 fragment :

.touchPerform([
{ action: 'longPress', options: { x: 50, y: 1800 }},
{ action: 'moveTo', options: { x: 50, y: 0 }},
{ action: 'release' }
])

如有任何建议,我们将不胜感激!

最佳答案

我有时仍然使用 driver.swipe,即使它已被弃用。

driver.swipe(width, startPoint, width, endPoint, duration);

更好的方法是:

TouchAction action = new TouchAction(driver);
action.press(startX, startY).moveTo((endX - startX), (endY-startY)).release().perform();

关于javascript - Appium - 滚动到一个不起作用的按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50808655/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com