I want to swipe down iphone 4s screen, screen size: 320x480. Firstly, i get screen width and hight:
static Integer getScreenWidth(IOSDriver driver){
return driver.manage().window().getSize().getWidth();
}
static Integer getScreenHeight(IOSDriver driver){
return driver.manage().window().getSize().getHeight();
}
And then i set percent of point that i want to swipe. I want to swipe from point (256, 422.4) to point (256.0 y: 168.0) so that screen device will down to see some another element in page.
And this is appium log:
[debug] [iOS] Executing iOS command 'click'
[debug] [UIAuto] Sending command to instruments: au.tapById('153')
[debug] [Instruments] [INST] 2016-05-27 03:09:07 +0000 Debug: responding with:
[debug] [Instruments] [INST] 2016-05-27 03:09:07 +0000 Debug: Running system command #236: /usr/local/Cellar/node/5.9.0/bin/node /usr/local/lib/node_modules/appium/node_modules/appium-uiauto/build/lib/bin/command-proxy-client.js /var/folders/fy/14y8wfl53qjfx_l1vnm3fc1r0000gn/T/instruments_sock 2,{"status":0,"value":[{"ELEMENT":"153"}]}...
[debug] [Instruments] [INST] 2016-05-27 03:09:08 +0000 Debug: Got new command 236 from instruments: au.tapById('153')
[debug] [Instruments] [INST] 2016-05-27 03:09:08 +0000 Debug: evaluating au.tapById('153')
[debug] [Instruments] [INST] 2016-05-27 03:09:08 +0000 Debug: target.frontMostApp().elements()[0].elements()[11].tap()
[debug] [Instruments] [INST] 2016-05-27 03:09:08 +0000 Debug: evaluation finished
[debug] [Instruments] [INST] 2016-05-27 03:09:08 +0000 Debug: responding with:
[debug] [UIAuto] Socket data received (25 bytes)
[debug] [UIAuto] Got result from instruments: {"status":0,"value":""}
[MJSONWP] Responding to client with driver.click() result: null
[HTTP] <-- POST /wd/hub/session/07c05101-ef89-464f-98cd-6882ab43aa55/element/153/click 200 1185 ms - 76
[debug] [Instruments] [INST] 2016-05-27 03:09:08 +0000 Debug: Running system command #237: /usr/local/Cellar/node/5.9.0/bin/node /usr/local/lib/node_modules/appium/node_modules/appium-uiauto/build/lib/bin/command-proxy-client.js /var/folders/fy/14y8wfl53qjfx_l1vnm3fc1r0000gn/T/instruments_sock 2,{"status":0,"value":""}...
[HTTP] --> GET /wd/hub/session/07c05101-ef89-464f-98cd-6882ab43aa55/window/current/size
[MJSONWP] Calling AppiumDriver.getWindowSize() with args: ["current","07c05101-ef89-464f-98cd-6882ab43aa55"]
[debug] [iOS] Executing iOS command 'getWindowSize'
[debug] [UIAuto] Sending command to instruments: au.getWindowSize()
[debug] [Instruments] [INST] 2016-05-27 03:09:09 +0000 Debug: Got new command 237 from instruments: au.getWindowSize()
[debug] [Instruments] [INST] 2016-05-27 03:09:09 +0000 Debug: evaluating au.getWindowSize()
[debug] [UIAuto] Socket data received (49 bytes)
[debug] [UIAuto] Got result from instruments: {"status":0,"value":{"width":320,"height":480}}
[MJSONWP] Responding to client with driver.getWindowSize() result: {"width":320,"height":480}
[HTTP] <-- GET /wd/hub/session/07c05101-ef89-464f-98cd-6882ab43aa55/window/current/size 200 1034 ms - 98
[debug] [Instruments] [INST] 2016-05-27 03:09:09 +0000 Debug: evaluation finished
[HTTP] --> GET /wd/hub/session/07c05101-ef89-464f-98cd-6882ab43aa55/window/current/size
[MJSONWP] Calling AppiumDriver.getWindowSize() with args: ["current","07c05101-ef89-464f-98cd-6882ab43aa55"]
[debug] [iOS] Executing iOS command 'getWindowSize'
[debug] [UIAuto] Sending command to instruments: au.getWindowSize()
[debug] [Instruments] [INST] 2016-05-27 03:09:09 +0000 Debug: responding with:
[debug] [Instruments] [INST] 2016-05-27 03:09:09 +0000 Debug: Running system command #238: /usr/local/Cellar/node/5.9.0/bin/node /usr/local/lib/node_modules/appium/node_modules/appium-uiauto/build/lib/bin/command-proxy-client.js /var/folders/fy/14y8wfl53qjfx_l1vnm3fc1r0000gn/T/instruments_sock 2,{"status":0,"value":{"width":320,"height":480}}...
[debug] [Instruments] [INST] 2016-05-27 03:09:11 +0000 Debug: Got new command 238 from instruments: au.getWindowSize()
[debug] [Instruments] [INST] 2016-05-27 03:09:11 +0000 Debug: evaluating au.getWindowSize()
[debug] [UIAuto] Socket data received (49 bytes)
[debug] [UIAuto] Got result from instruments: {"status":0,"value":{"width":320,"height":480}}
[MJSONWP] Responding to client with driver.getWindowSize() result: {"width":320,"height":480}
[HTTP] <-- GET /wd/hub/session/07c05101-ef89-464f-98cd-6882ab43aa55/window/current/size 200 1067 ms - 98
[HTTP] --> GET /wd/hub/session/07c05101-ef89-464f-98cd-6882ab43aa55/window/current/size
[MJSONWP] Calling AppiumDriver.getWindowSize() with args: ["current","07c05101-ef89-464f-98cd-6882ab43aa55"]
[debug] [iOS] Executing iOS command 'getWindowSize'
[debug] [UIAuto] Sending command to instruments: au.getWindowSize()
[debug] [Instruments] [INST] 2016-05-27 03:09:11 +0000 Debug: evaluation finished
[debug] [Instruments] [INST] 2016-05-27 03:09:11 +0000 Debug: responding with:
[debug] [Instruments] [INST] 2016-05-27 03:09:11 +0000 Debug: Running system command #239: /usr/local/Cellar/node/5.9.0/bin/node /usr/local/lib/node_modules/appium/node_modules/appium-uiauto/build/lib/bin/command-proxy-client.js /var/folders/fy/14y8wfl53qjfx_l1vnm3fc1r0000gn/T/instruments_sock 2,{"status":0,"value":{"width":320,"height":480}}...
[debug] [Instruments] [INST] 2016-05-27 03:09:12 +0000 Debug: Got new command 239 from instruments: au.getWindowSize()
[debug] [Instruments] [INST] 2016-05-27 03:09:12 +0000 Debug: evaluating au.getWindowSize()
[debug] [Instruments] [INST] 2016-05-27 03:09:12 +0000 Debug: evaluation finished
[debug] [UIAuto] Socket data received (49 bytes)
[debug] [UIAuto] Got result from instruments: {"status":0,"value":{"width":320,"height":480}}
[MJSONWP] Responding to client with driver.getWindowSize() result: {"width":320,"height":480}
[HTTP] <-- GET /wd/hub/session/07c05101-ef89-464f-98cd-6882ab43aa55/window/current/size 200 1015 ms - 98
[HTTP] --> GET /wd/hub/session/07c05101-ef89-464f-98cd-6882ab43aa55/window/current/size
[MJSONWP] Calling AppiumDriver.getWindowSize() with args: ["current","07c05101-ef89-464f-98cd-6882ab43aa55"]
[debug] [iOS] Executing iOS command 'getWindowSize'
[debug] [UIAuto] Sending command to instruments: au.getWindowSize()
[debug] [Instruments] [INST] 2016-05-27 03:09:12 +0000 Debug: responding with:
[debug] [Instruments] [INST] 2016-05-27 03:09:12 +0000 Debug: Running system command #240: /usr/local/Cellar/node/5.9.0/bin/node /usr/local/lib/node_modules/appium/node_modules/appium-uiauto/build/lib/bin/command-proxy-client.js /var/folders/fy/14y8wfl53qjfx_l1vnm3fc1r0000gn/T/instruments_sock 2,{"status":0,"value":{"width":320,"height":480}}...
[debug] [Instruments] [INST] 2016-05-27 03:09:13 +0000 Debug: Got new command 240 from instruments: au.getWindowSize()
[debug] [Instruments] [INST] 2016-05-27 03:09:13 +0000 Debug: evaluating au.getWindowSize()
[debug] [UIAuto] Socket data received (49 bytes)
[debug] [UIAuto] Got result from instruments: {"status":0,"value":{"width":320,"height":480}}
[MJSONWP] Responding to client with driver.getWindowSize() result: {"width":320,"height":480}
[HTTP] <-- GET /wd/hub/session/07c05101-ef89-464f-98cd-6882ab43aa55/window/current/size 200 911 ms - 98
[HTTP] --> POST /wd/hub/session/07c05101-ef89-464f-98cd-6882ab43aa55/touch/perform
[MJSONWP] Calling AppiumDriver.performTouch() with args: [[{"action":"press","options":{"x":256,"y":422}},{"action":"wait","options":{"ms":3000}},{"action":"moveTo","options":{"x":256,"y":168}},{"action":...
[debug] [iOS] Executing iOS command 'performTouch'
[debug] [UIAuto] Sending command to instruments: target.touch([{"touch":[{"x":256,"y":422}],"time":0.2},{"touch":[{"x":256,"y":422}],"time":3.2},{"touch":[{"x":512,"y":590}],"time":3.4000000000000004}])
[debug] [Instruments] [INST] 2016-05-27 03:09:13 +0000 Debug: evaluation finished
[debug] [Instruments] [INST] 2016-05-27 03:09:13 +0000 Debug: responding with:
[debug] [Instruments] [INST] 2016-05-27 03:09:13 +0000 Debug: Running system command #241: /usr/local/Cellar/node/5.9.0/bin/node /usr/local/lib/node_modules/appium/node_modules/appium-uiauto/build/lib/bin/command-proxy-client.js /var/folders/fy/14y8wfl53qjfx_l1vnm3fc1r0000gn/T/instruments_sock 2,{"status":0,"value":{"width":320,"height":480}}...
[debug] [Instruments] [INST] 2016-05-27 03:09:14 +0000 Debug: Got new command 241 from instruments: target.touch([{"touch":[{"x":256,"y":422}],"time":0.2},{"touch":[{"x":256,"y":422}],"time":3.2},{"touch":[{"x":512,"y":590}],"time":3.4000000000000004}])
[debug] [Instruments] [INST] 2016-05-27 03:09:14 +0000 Debug: evaluating target.touch([{"touch":[{"x":256,"y":422}],"time":0.2},{"touch":[{"x":256,"y":422}],"time":3.2},{"touch":[{"x":512,"y":590}],"time":3.4000000000000004}])
[debug] [Instruments] [INST] 2016-05-27 03:09:14 +0000 Debug: target.touch(__NSCFArray)
[debug] [Instruments] [INST] 2016-05-27 03:09:17 +0000 Debug: point is not within the bounds of the screen
[debug] [Instruments] [INST] 2016-05-27 03:09:17 +0000 Error: VerboseError: point is not within the bounds of the screen
[debug] [UIAuto] Socket data received (70 bytes)
[debug] [UIAuto] Got result from instruments: {"status":17,"value":"point is not within the bounds of the screen"}
[HTTP] <-- POST /wd/hub/session/07c05101-ef89-464f-98cd-6882ab43aa55/touch/perform 500 4543 ms - 131
[debug] [Instruments] [INST] 2016-05-27 03:09:17 +0000 Error: Error during eval: touch@[native code]
eval code
eval@[native code]
startProcessing@file:///usr/local/lib/node_modules/appium/A86032DC-6610-48DD-B83B-3D1BD1541D5E/bootstrap-5e34876f27a599d3.js:2793:30
bootstrap@file:///usr/local/lib/node_modules/appium/A86032DC-6610-48DD-B83B-3D1BD1541D5E/bootstrap-5e34876f27a599d3.js:2861:31
global code@file:///usr/local/lib/node_modules/appium/A86032DC-6610-48DD-B83B-3D1BD1541D5E/bootstrap-5e34876f27a599d3.js:2870:10
[debug] [Instruments] [INST] 2016-05-27 03:09:17 +0000 Debug: responding with:
[debug] [Instruments] [INST] 2016-05-27 03:09:17 +0000 Debug: Running system command #242: /usr/local/Cellar/node/5.9.0/bin/node /usr/local/lib/node_modules/appium/node_modules/appium-uiauto/build/lib/bin/command-proxy-client.js /var/folders/fy/14y8wfl53qjfx_l1vnm3fc1r0000gn/T/instruments_sock 2,{"status":17,"value":"point is not within the bounds of the screen"}...
[HTTP] --> POST /wd/hub/session/07c05101-ef89-464f-98cd-6882ab43aa55/timeouts
[MJSONWP] Calling AppiumDriver.timeouts() with args: ["implicit",0,"07c05101-ef89-464f-98cd-6882ab43aa55"]
[debug] [iOS] Executing iOS command 'timeouts'
[MJSONWP] Responding to client with driver.timeouts() result: null
[HTTP] <-- POST /wd/hub/session/07c05101-ef89-464f-98cd-6882ab43aa55/timeouts 200 2 ms - 76
[HTTP] --> GET /wd/hub/session/07c05101-ef89-464f-98cd-6882ab43aa55/context
[MJSONWP] Calling AppiumDriver.getCurrentContext() with args: ["07c05101-ef89-464f-98cd-6882ab43aa55"]
[debug] [iOS] Executing iOS command 'getCurrentContext'
[MJSONWP] Responding to client with driver.getCurrentContext() result: "NATIVE_APP"
[HTTP] <-- GET /wd/hub/session/07c05101-ef89-464f-98cd-6882ab43aa55/context 200 3 ms - 84
[HTTP] --> POST /wd/hub/session/07c05101-ef89-464f-98cd-6882ab43aa55/elements
[MJSONWP] Calling AppiumDriver.findElements() with args: ["xpath","//UIAApplication[1]/UIAWindow[1]/UIATabBar[1]/UIAButton[4]","07c05101-ef89-464f-98cd-6882ab43aa55"]
[debug] [iOS] Executing iOS command 'findElements'