[英]How to swipe in appium real device my swipe is Deprecated
How to swipe in appium real device my swipe is
Deprecated
in the latest android studio 2.3.3
i am using java client 5.00 BETA 6 in eclipse
appium server desktop 1.7
i tried the following method none works
following code does not not swipe the page down
i am trying to swipe in device setting to click down page which is
not visible in view
1. new TouchAction(driver)
.longPress(393, 446)
.moveTo(1902, 407)
.release()
.perform();
2. driver.swipe(startx, starty, endx, endy, duration); its depreceted
3.
MobileElement element = (MobileElement)
driver.findElement(By.xpath("//android.widget.TextView[contains(@resource-
id,'title') and @text='Display']"));
JavascriptExecutor js = (JavascriptExecutor)driver;
HashMap<String, String> scrollObject = new HashMap<String, String>();
scrollObject.put("direction", "down");
scrollObject.put("element", ((RemoteWebElement) element).getId());
scrollObject.put("text", "Memory");
js.executeScript("mobile: scrollTo", scrollObject);
please help me to overcome from this i in deed stuck with this last
2 weeks please help me to overcome from this
Also please help me to swipe from left to
bottom as i need to know about
swipe in details i in deed stuck in
appium swipe please help me come out out of this i tried lot of method
大多数情况下它不会起作用,请帮助我,也请帮助我从左向左滑动,因为我需要详细了解滑动方式,我的行为仍停留在如何在appium真实设备中滑动,我的滑动方式已弃用
您是否尝试过等待该TouchAction?
你有:
new TouchAction(driver)
.longPress(393, 446)
.moveTo(1902, 407)
.release()
.perform();
尝试以下操作(将longPress更改为只需按下即可):
//Coordinates are relative, So at .moveTo(x,y) you have to add how many X and Y
do you want to moveTo from the start where you pressed...
new TouchAction(driver)
.press(393, 446)
.wait(500)
.moveTo(400, 0) //This will move 400px from start point (393)
.release()
.perform();
注意 :您的屏幕大小是对moveTo的限制(对于.press,也可以单击...)。如果您的screenWidth是800,而您是.press(400,anyY),则在moveTo只能添加.moveTo(400 ...
并通过驱动程序滑动( 已弃用 ...)
//startX, startY, endX, endY and 1tap
driver.swipe(393, 446, 1902, 407, 1)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.