java-client: Cannot swipe from bottom to top on ios

I would like to set the wifi status on ios and in order to do that, I need to to swipe up from the bottom the Control Center.

        dimension = driverWrapper.getIosDriver().manage().window().getSize();
        int middleX = dimension.getWidth() / 2;
        int y = dimension.getHeight();
        driverWrapper.getIosDriver().swipe(middleX,y - 10 ,middleX,150,600);

// action = new TouchAction(driverWrapper.getIosDriver()); // action.press(middleX, y - 10 ).waitAction(100) // .moveTo(middleX, y / 2).release().perform();

I used both of the codes and nothing works. Before I upgraded java client to 4.0.0 and appium to 1.5.2 it worked correctly.

Environment

  • java client build version or git revision if you use some shapshot: 4.0.0
  • Appium server version or git revision if you use some shapshot: 1.5.2
  • Desktop OS/version used to run Appium if necessary: mac os
  • Node.js version (unless using Appium.app|exe) or Appium CLI or Appium.app|exe:
  • Mobile platform/version under test: ios 9 and above
  • Real device or emulator/simulator: real device

Ecxeption stacktraces

I get an error of: Error: VerboseError: point is not within the bounds of the screen

Link to Appium logs

[debug] [UIAuto] Socket data received (49 bytes) [debug] [UIAuto] Got result from instruments: {“status”:0,“value”:{“width”:320,“height”:568}} [MJSONWP] Responding to client with driver.getWindowSize() result: {“width”:320,“height”:568} [HTTP] <-- GET /wd/hub/session/31411e39-f408-418f-b9b8-e28b80ba1b35/window/current/size 200 1071 ms - 98 [HTTP] --> POST /wd/hub/session/31411e39-f408-418f-b9b8-e28b80ba1b35/touch/perform {“actions”:[{“action”:“press”,“options”:{“x”:160,“y”:558}},{“action”:“wait”,“options”:{“ms”:100}},{“action”:“moveTo”,“options”:{“x”:160,“y”:284}},{“action”:“release”,“options”:{}}]} [MJSONWP] Calling AppiumDriver.performTouch() with args: [[{“action”:“press”,“options”:{“x”:160,“y”:558}},{“action”:“wait”,“options”:{“ms”:100}},{“action”:“moveTo”,“options”:{“x”:160,“y”:284}},{“action”:"… [debug] [iOS] Executing iOS command ‘performTouch’ [debug] [UIAuto] Sending command to instruments: target.touch([{“touch”:[{“x”:160,“y”:558}],“time”:0.2},{“touch”:[{“x”:160,“y”:558}],“time”:0.30000000000000004},{“touch”:[{“x”:320,“y”:842}],“time”:0.5}])

[debug] [Instruments] [INST] 2016-06-19 07:39:13 +0000 Debug: Got new command 6 from instruments: target.touch([{“touch”:[{“x”:160,“y”:558}],“time”:0.2},{“touch”:[{“x”:160,“y”:558}],“time”:0.30000000000000004},{“touch”:[{“x”:320,“y”:842}],“time”:0.5}])

[debug] [Instruments] [INST] 2016-06-19 07:39:13 +0000 Debug: evaluating target.touch([{“touch”:[{“x”:160,“y”:558}],“time”:0.2},{“touch”:[{“x”:160,“y”:558}],“time”:0.30000000000000004},{“touch”:[{“x”:320,“y”:842}],“time”:0.5}])

[debug] [Instruments] [INST] 2016-06-19 07:39:13 +0000 Debug: target.touch(__NSCFArray)

[debug] [Instruments] [INST] 2016-06-19 07:39:13 +0000 Debug: point is not within the bounds of the screen

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 22 (6 by maintainers)

Most upvoted comments

You did nothing wrong. It seems to be the expected behavior for some reason. I gave up after a lot of search and workarounds. I switched back to an older version of appium (1.4.16) and now it works perfectly.