【发布时间】:2016-06-08 16:43:19
【问题描述】:
对于我的原生 Android 应用程序,过去 2 周我一直在尝试让 appium 在我的原生应用程序上向下滚动。我试过driver.scrollTo("Accounts");
然后我得到了这个错误
[org.openqa.selenium.WebDriverException: CATCH_ALL: io.selendroid.server.common.exceptions.SelendroidException: method (by) not found: -android uiautomator
以及我发现的许多其他示例。似乎没有任何效果。这是我尝试过的最新示例。
使用 appium 1.5.2 和 appium java 客户端版本:‘3.3.0’。当我尝试运行以下代码时。
TouchAction tAction=new TouchAction(driver);
int startx = driver.findElement(By.id("line_chart_line_chart")).getLocation().getX();
int starty = driver.findElement(By.id("line_chart_line_chart")).getLocation().getY();
int endx = driver.findElement(By.id("actionBarLogo")).getLocation().getX();
int endy = driver.findElement(By.id("actionBarLogo")).getLocation().getY();
System.out.println(startx + " ::::::: " + starty + " ::::::: " + endx + " ::::::: " + endy);
// This is what the console printed out startX=560 ::::::: starty=1420 ::::::: endx=560 ::::::: endy=240
//First tap on the screen and swipe up using moveTo function
tAction.press(startx,starty).moveTo(endx,endy).release().perform();
然后我收到此错误消息
org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: Could not proxy. Proxy
error: Could not proxy command to remote server. Original error: 404 - undefined (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 27 milliseconds
我不知道该怎么办。为了点击一个元素,它必须在屏幕上可见。为了让这个元素出现在屏幕上,我需要向下滚动到它。
有什么我做错了吗???我似乎无法弄清楚。
【问题讨论】:
标签: java android scroll appium