I’m trying to run tests on the iOS 7 sim, and one action I need to perform is Swipe. In touch_actions.rb, there’s a method for swiping (called "swipe) which doesn’t seem to do anything. In the comments above it says “Note that iOS 7 simulators have broken swipe”. Is there a fix or work around for performing swipe?
Is there a way to perform multi touch actions with the execute_script? How to do a longpress and scroll down (which is equivalent to pull to refresh action)
Thanks for the suggestions. Unfortunately the scrollTo method won’t work (:mobile methods deprecated) and the python script workaround isn’t ideal for us.
Hi palas, I’m trying to pinch and zoom using swipe in ruby, could you please share your command for the horizontal swipe? I keep getting a javascript error!
This will swipe from (10,10) to (50,10). I’ve created a method to implement that to specific elements, so you pass an element and based on the element position and size swipe on it, but I don’t know how can you do make it pinch to zoom with that…
I thought of using multi touch. But I dont think thats possible on using execute script. Is this working on IOS 7 simulator? I’m not able to see it work there
What Appium version are you using? I am asking that because there are several bugs with the 1.2.2 version, it crashes instruments when accessing multiple elements and other major bugs, so I gave up on it and I am using version 1.1.0 - and in that version swipe works for the elements I am swiping on.
Before downgrading the node version it probably worth to just download the app in the version 1.1.0, run the server from there and see how it performs.
Does the :mobile swipe method still work on 1.1.0? I thought they were deprecated after 1.x. When I try to call it I get an error regarding a non-implemented method (the :mobile method)
I m trying to do horizontal swipe for iOS 7. I used below code.
JavascriptExecutor js = (JavascriptExecutor) wd;
HashMap<String, Double> swipeObject = new HashMap<String, Double>();
swipeObject.put(“touchCount”, 1.00);
swipeObject.put(“startX”, 0.73);
swipeObject.put(“startY”, 2.11);
swipeObject.put(“endX”, 2.26);
swipeObject.put(“endY”, 2.12);
swipeObject.put(“duration”, 0.5);
js.executeScript(“mobile:swipe”, swipeObject);
I m getting error,
yeah, finally got it working. Strange, not sure what I was doing wrong. Tried now with pixel, percentage, applied to an element or all app and it works fine.
I needed the swipe functionality to activate and present a left pane menu on an iPad application my team is developing and it worked after a few attempts of trying different methods etc.
Please see the below java code as a reference on what worked for me: