java - 如何滚动到“手表部分”Appium
问题描述
我的滚动条一直滚动到底部。
但我需要向下滚动到“手表部分”,我无法执行。
loginpage.getMensFashionList().click();//clicks on Mens Fashion
//Scroll to watches section.
driver.findElementByAndroidUIAutomator("new UiScrollable(new UiSelector().scrollable(true).instance(0)).scrollIntoView(new UiSelector().textMatches(\"Watches\").instance(0))");
点击男士时尚后,我需要滚动到手表部分,因为我对手表很感兴趣。
需要帮助才能滚动到手表部分。
解决方案
driver.findElement(MobileBy.AndroidUIAutomator(
"new UiScrollable(new UiSelector().resourceId(\"your scrollable list id\")).scrollIntoView("
+ "new UiSelector().textContains(\"Watches\").instance(1))"));
推荐阅读
- java - 如何在 spring-boot 多模块 Java 11 项目中添加 Spark 依赖项
- c# - 如何在 C# 中获取网格控件列以显示带两位小数的价格?
- sql - 如何在不重复员工 ID 的情况下计算表中的姓氏
- c# - 如何构建具有一些预定义配置的其他依赖项目的 csproj
- node.js - 我的 Lambda 在代码完成之前结束 - node.js
- angular - vojtechhabarta / typescript-generator / HttpClient
- python - 为什么 contains 不能选择包含指定字符串的行?
- android - 如何避免 Android Studio 中的 Fragment 崩溃?
- extjs - ActionColumn 渲染器函数有时不会触发
- c# - 使用 itextsharp 下载后图像不会出现在 PDF 上