Skip to content

iOS Swipe action based on co-ordinates does swipe outside of co-ordinates provided #784

@vikramvi

Description

@vikramvi

Description

  1. User want to do swipe action vertically based on co-ordinates ranges as below
JavascriptExecutor js = (JavascriptExecutor)getDriver();
HashMap<String, String> swipeObject = new HashMap<String, String>();
 swipeObject.put("direction", "up");
 swipeObject.put("startX", "90");
 swipeObject.put("startY", "400");
 swipeObject.put("endX", "90");
 swipeObject.put("endY", "200");
 //swipeObject.put("duration", "0.5");
 js.executeScript("mobile: swipe", swipeObject);
  1. With above code expectation is that similar to Android platform, swipe should happen between StartY to EndY, but it's observed that swipe action does quite a lot of swapping than expected.

  2. Appium server log

[XCUITest] Merging WDA caps over Appium caps for session detail response
[debug] [MJSONWP] Responding to client with driver.getSession() result: {"udid":"2DC94AFA-BA4D-4BA6-A857-567C31B1BFC0","app":"/Users/vikramanna/Documents/vikram/AppiumSerenityPOC/tw_mobile.app","automationName":"XCUITest","deviceName":"iPhone SE","platformName":"iOS","platformVersion":"11.2","device":"iphone","browserName":"TWM Dev","sdkVersion":"11.2","CFBundleIdentifier":"com.totalwine.app.beta.dev"}
[HTTP] <-- GET /wd/hub/session/66c76899-22a1-4818-a1b7-e3a71d432a10 200 58 ms - 405 
[HTTP] --> POST /wd/hub/session/66c76899-22a1-4818-a1b7-e3a71d432a10/execute {"script":"mobile: swipe","args":[{"endY":"200","endX":"90","startY":"400","startX":"90","direction":"up"}]}
[debug] [MJSONWP] Calling AppiumDriver.execute() with args: ["mobile: swipe",[{"endY":"200","endX":"90","startY":"400","startX":"90","direction":"up"}],"66c76899-22a1-4818-a1b7-e3a71d432a10"]
[debug] [XCUITest] Executing command 'execute'
[debug] [BaseDriver] Waiting up to 18000 ms for condition
[debug] [JSONWP Proxy] Proxying [POST /element] to [POST http://localhost:8100/session/BDEDA9BF-D7F5-4BAB-9FD8-ACEBC26CD785/element] with body: {"using":"class name","value":"XCUIElementTypeApplication"}
[debug] [JSONWP Proxy] Got response with status 200: {"value":{"ELEMENT":"8D2F7D83-2900-41DB-BC8E-6A9E0C75CDD8"},"sessionId":"BDEDA9BF-D7F5-4BAB-9FD8-ACEBC26CD785","status":0}
[debug] [JSONWP Proxy] Proxying [POST /wda/element/8D2F7D83-2900-41DB-BC8E-6A9E0C75CDD8/swipe] to [POST http://localhost:8100/session/BDEDA9BF-D7F5-4BAB-9FD8-ACEBC26CD785/wda/element/8D2F7D83-2900-41DB-BC8E-6A9E0C75CDD8/swipe] with body: {"direction":"up"}
[debug] [JSONWP Proxy] Got response with status 200: {"value":{},"sessionId":"BDEDA9BF-D7F5-4BAB-9FD8-ACEBC26CD785","status":0}
[debug] [MJSONWP] Responding to client with driver.execute() result: {}
[HTTP] <-- POST /wd/hub/session/66c76899-22a1-4818-a1b7-e3a71d432a10/execute 200 2718 ms - 74 
[HTTP] --> GET /wd/hub/session/66c76899-22a1-4818-a1b7-e3a71d432a10 {}
[debug] [MJSONWP] Calling AppiumDriver.getSession() with args: ["66c76899-22a1-4818-a1b7-e3a71d432a10"]
[debug] [XCUITest] Executing command 'getSession'

  1. I tried giving smaller range of co-ordinates, changing duration value as well. But appium always does swipe range outside given one.

Please clarify if this is client / server bug or something wrong in code itself ?

Environment

  • java client build version or git revision if you use some shapshot: 5.0.4
  • Appium server version or git revision if you use some shapshot: v1.7.2-beta2
  • Desktop OS/version used to run Appium if necessary: Mac
  • Node.js version (unless using Appium.app|exe) or Appium CLI or Appium.app|exe: CLI
  • Mobile platform/version under test: iOS 11.2
  • Real device or emulator/simulator: Simulator

Details

Please provide more details, if necessary.

Code To Reproduce Issue [ Good To Have ]

Already mentioned in description

Ecxeption stacktraces

NA

Link to Appium logs

mentioned in description

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions