Appium滑動問題研究
阿新 • • 發佈:2019-01-29
JavascriptExecutor js =(JavascriptExecutor) driver; HashMap<String,Double> flickObject =newHashMap<String,Double>(); flickObject.put("startX",0.8); flickObject.put("startY",0.5); flickObject.put("endX",0.2); flickObject.put("endY",0.5);
flickObject.put("element",Double.valueOf(((RemoteWebElement ) element).getId()));
js.executeScript("mobile: flick", flickObject););
3.scroll操作,專為iOS 7.x而生,官方的解釋如下
An unfortunate bug exists in the iOS 7.x Simulator where ScrollViews don't recognize gestures initiated by UIAutomation (which Appium uses under the hood for iOS). To work around this, we have provided access to a different function, scroll, which in many cases allows you to do what you wanted to do with a ScrollView, namely, scroll it!