Swiping up to reveal control center

I’m automating a test on a real device and need to turn off wi-fi. Ressearching other questions, I saw the most recommended method was swiping up from the bottom of the screen to reveal the control center, and then turning off the wi-fi from there. However, I’ve been unable to do this with TouchActions. I’ve been trying variations of this:
touchAction.press(width/2, height).waitAction(Duration.ofMillis(90)).moveTo(0, height).release().perform();
But instead of revealing the control center, this seems only to be accidentally clicking on elements in my screen.
Another suggestion I’ve been given was to use the virtual home button to access the control center, however, tapping on the screen coordinates of the button doesn’t seem to do anything either.
Any suggestions?
I’m using java client 5.0.0-BETA9 and Appium 1.7.2.

Be careful of your touch action coordinates here. Your ‘start’ is fine, but your end is just moving from (w/2,h) -> (0,h) so you’re just moving from the middle of the bottom of the screen to the bottom left corner. Check those coordinates and you should be okay.

Aren’t touchActions relative, though? Actually, them being relative means that the correct code should be touchAction.press(width/2, height).waitAction(Duration.ofMillis(90)).moveTo(0, -height).release().perform();, to move from bottom to top of the screen, but this code bit doesn’t work too. :pensive:

Ah, you’re right… in Appium 1.7.2 TouchActions are relative for IOS (but not Android). I’m working on upgrading to 1.8 (but hitting other issues), and there it’s all absolute. I’d suggest only scrolling up 1/2 way… see if that does anything. Also take a look at which element is being “clicked”, and where it is on the screen.

I tried scrolling up 1/2 way, 1/4, and even just 10px up and none of these worked. Very strangely, the element that’s being selected is on the top of the screen, far from the region where the scroll is supposed to be happening. :confused:

Can you get the appium logs around the touchaction? It’d be interesting to see what they’re sending the WDA. You should probably also upgrade to java client 5.0.4 to make sure you’re up-to-date.

I upgraded to 5.0.4, no luck so far. I’m trying to use one of the Appium sample apps to make it simpler, and the same thing happens in it. The Appium logs around the TouchAction are these:

What version of Appium Server are you using? I’d suggest 1.7.2. The other thing you can try is to use the js execute with IOS. Though I don’t know where this will swipe.

Map<String, Object> params = new HashMap<>();
params.put("direction", "up");
js.executeScript("mobile: swipe", params);

I’m using 1.7.2, too. Tried with the executor, the behaviour was the same.

Hmmm… can you try with a different app (like safari or some default app?) It may be a bug with your app under test.

I updated Appium to 1.8 version and the swiping is now behaving as it should. This solved my swiping problem, but now I have a ton of compatibility issues with my Selenium and Chromedriver versions. :sweat: Well, gonna try to solve it. Thanks for the help!