I am unable to swipe an element . Tried many options
-
e.swipe(SwipeElementDirection.RIGHT, 6000);
Tried changing the duration to suit the swipe but it just doesn’t reach the desired co-ordinates.This attempts to swipe but is ultimately unable to. -
touchaction.press(center.x,center.y).waitAction(400).moveTo(center.x+157, center.y).release();
touchaction.perform();
On debugging the script crashes on the touchaction.perform() throwing the error : org.openqa.selenium.WebDriverException: An error occurred while executing user supplied JavaScript.
- JavascriptExecutor js =(JavascriptExecutor)(driver.innerDriver);
HashMap<String,Integer> swipeObject = new HashMap<String,Integer>();
swipeObject.put(“startX”, center.x);
swipeObject.put(“StartY”, center.y);
swipeObject.put(“endX”, center.x+157);
swipeObject.put(“endY”, center.y);
swipeObject.put(“duration”, 4);
js.executeScript(“mobile: swipe”, swipeObject);
The above script gives the org.openqa.selenium.WebDriverException: Not yet implemented. error. I have tried using this with both webelement and the MobileElement.
- new Actions(driver.innerDriver).dragAndDropBy(element, center.x+157, center.y).build().perform(); gives Not Yet Implemented error.
Any workaround possible for the swipe function.