react-native - 如何在移动应用程序上使用 appium 自动化反应原生轮播?
问题描述
我的移动应用程序引入了需要自动化的轮播。这可以使用 TouchActions 自动化吗?有没有人尝试过?
需要在 Android 和 iOS 上都这样做。
轮播 - https://github.com/meliorence/react-native-snap-carousel
解决方案
我使用以下内容来处理相同的问题:
public static void pickerWheelByCount(By by, int count, String direction) {
try {
AppiumDriver<MobileElement> driver = DriverManager.getDriver();
HashMap<String, Object> params = new HashMap<>();
params.put("order", direction);
params.put("offset", 0.15);
params.put("element", driver.findElement(by));
int i = 1;
while (i <= count) {
i++;
driver.executeScript("mobile: selectPickerWheelValue", params);
} } catch(Exception e) {
}
}
推荐阅读
- reactjs - 在 Material-UI CardMedia 中显示加载器
- data-structures - AVL树:叶子深度之间的差异?
- ms-access - 访问 - 存储在文本框中的 GUID 值,不能在 SELECT 语句中使用
- python - Python with statement: '语法错误:无效语法'
- java - Libgdx Box2d 身体在坠落时失去速度
- android - 通过更改菜单中的请求 URL 对 JSON 数组进行排序
- c# - .NET webapi 响应慢 | IIS 花费的时间超过了应用程序执行所花费的平均时间
- amazon-web-services - 如何使我的集装箱港口可以在集装箱外进入?ECS-AWS
- makefile - 并非所有变量都在 Makefile 中递归扩展
- npm - 使用 NPM 安装引导程序