android - 如何使用android驱动程序在selenium中执行向下滚动操作(直到一定限制,而不是元素可见性)
问题描述
driver.findElementByAndroidUIAutomator("new UiScrollable(new UiSelector()
.scrollable(true).instance(0))
.scrollIntoView(new UiSelector()
.textContains(\""+text+"\").instance(0))");
此语法适用于元素可见性。我需要一种可以向下滚动到特定维度的语法。
解决方案
您可以使用以下代码滚动购买,只需为您提供从 (x,y) 到位置 (x,y) 的坐标
new TouchAction(driver).press(PointOption.point(449,1830)).waitAction(WaitOptions.waitOptions(Duration.ofSeconds(1))).moveTo(PointOption.point(449, 333)).release().perform();
推荐阅读
- android - 干净的架构和身份验证
- c# - 如何创建或使用现成的 Shims 从 .net 框架移植到 .net 核心/标准?
- css - 协助引导响应相同高度的列,但也有边框
- elasticsearch - 如何影响 Elasticsearch 自动建议查询以首先返回完全匹配?
- vb.net - 将整数添加到 vb.net 中的另一个整数?
- javascript - JavaScript中的BFS图遍历在玩具上工作,而不是实际问题
- powershell - SCCM Powershell 脚本包
- python - 如何转换为完整的 JSON
- opengl - 如何通过只发送一次数据使着色器褪色?
- llvm - 哪些 LLVM 指令可以退出函数?