【发布时间】:2016-10-07 12:50:27
【问题描述】:
【问题讨论】:
标签: javascript java selenium selenium-webdriver appium
【问题讨论】:
标签: javascript java selenium selenium-webdriver appium
对于上述情况,请执行以下操作:
WebElement elem = driver.findElementByXPath("//ur elem xpath");
int x = elem.getLocation().getX();
int y = elem.getLocation().getY();
TouchAction action = new TouchAction(driver);
action.longPress(x+5,y+5).waitAction(3000).moveTo(100,0).perform().release();
告诉我会发生什么
【讨论】:
@noor 这对我有用
JavascriptExecutor js = (JavascriptExecutor) driver;
HashMap<String, Double> swipeObject = new HashMap<String, Double>();
swipeObject.put("startX", 279.2);
swipeObject.put("startY", 93.1);
swipeObject.put("endX", 136.1);
swipeObject.put("endY", 92.6);
swipeObject.put("duration", 3.0);
js.executeScript("mobile: flick", swipeObject);
【讨论】: