Skip to content

rename end_x and end_y to delta_x and delta_y #293

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wensj opened this issue Dec 12, 2014 · 4 comments
Closed

rename end_x and end_y to delta_x and delta_y #293

wensj opened this issue Dec 12, 2014 · 4 comments

Comments

@wensj
Copy link

wensj commented Dec 12, 2014

I am not sure this is a bug of appium or ruby_lib.The UIAMapView location is {35,83} and size is {250,250}.So I use TouchAction to try to pinch the UIAMapView,like this:
map = find_element :xpath,"//UIAMapView[1]"
puts map.location.x
puts map.location.y

top = Appium::TouchAction.new
top.swipe start_x: 35, start_y: 83, end_x: 65, end_y: 113, duration: 500

bottom = Appium::TouchAction.new
bottom.swipe(start_x: 285,start_y: 333, end_x: 235, end_y: 283, duration: 500)

pinch = Appium::MultiTouch.new
pinch.add top
pinch.add bottom
pinch.perform
I get this error:
point is not within the bounds of the screen (Selenium::WebDriver::Error::JavascriptError)

@wensj
Copy link
Author

wensj commented Dec 12, 2014

server log:

info: [debug] [INST] 2014-12-07 04:40:39 +0000 Debug: Got new command 6 from instruments: au.getElementByIndexPath('/0/0/0')

info: [debug] [INST] 2014-12-07 04:40:39 +0000 Debug: evaluating au.getElementByIndexPath('/0/0/0')

info: [debug] [INST] 2014-12-07 04:40:39 +0000 Debug: evaluation finished
info: [debug] [INST] 2014-12-07 04:40:39 +0000 Debug: responding with:
info: [debug] [INST] 2014-12-07 04:40:39 +0000 Debug: Running system command #7: /Applications/Appium.app/Contents/Resources/node/bin/node /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-uiauto/bin/command-proxy-client.js /tmp/instruments_sock 2,{"status":0,"value":{"ELEMENT":"1"}}...

info: [debug] Socket data received (38 bytes)
info: [debug] Socket data being routed.
info: [debug] Got result from instruments: {"status":0,"value":{"ELEMENT":"1"}}
info: [debug] Responding to client with success: {"status":0,"value":{"ELEMENT":"1"},"sessionId":"2debc140-5e74-48d3-adea-a3b9b40463fd"}
info: <-- POST /wd/hub/session/2debc140-5e74-48d3-adea-a3b9b40463fd/element 200 2311.527 ms - 87 {"status":0,"value":{"ELEMENT":"1"},"sessionId":"2debc140-5e74-48d3-adea-a3b9b40463fd"}
info: --> POST /wd/hub/session/2debc140-5e74-48d3-adea-a3b9b40463fd/touch/multi/perform {"actions":[[{"action":"press","options":{"x":35,"y":83}},{"action":"wait","options":{"ms":500}},{"action":"moveTo","options":{"x":65,"y":113}},{"action":"release"}],[{"action":"press","options":{"x":285,"y":333}},{"action":"wait","options":{"ms":500}},{"action":"moveTo","options":{"x":235,"y":283}},{"action":"release"}]]}
info: [debug] Pushing command to appium work queue: "target.touch([{"time":0.2,"touch":[{"x":35,"y":83},{"x":285,"y":333}]},{"time":0.7,"touch":[{"x":35,"y":83},{"x":285,"y":333}]},{"time":0.8999999999999999,"touch":[{"x":100,"y":196},{"x":520,"y":616}]}])"
info: [debug] Sending command to instruments: target.touch([{"time":0.2,"touch":[{"x":35,"y":83},{"x":285,"y":333}]},{"time":0.7,"touch":[{"x":35,"y":83},{"x":285,"y":333}]},{"time":0.8999999999999999,"touch":[{"x":100,"y":196},{"x":520,"y":616}]}])

info: [debug] [INST] 2014-12-07 04:40:40 +0000 Debug: Got new command 7 from instruments: target.touch([{"time":0.2,"touch":[{"x":35,"y":83},{"x":285,"y":333}]},{"time":0.7,"touch":[{"x":35,"y":83},{"x":285,"y":333}]},{"time":0.8999999999999999,"touch":[{"x":100,"y":196},{"x":520,"y":616}]}])

info: [debug] [INST] 2014-12-07 04:40:40 +0000 Debug: evaluating target.touch([{"time":0.2,"touch":[{"x":35,"y":83},{"x":285,"y":333}]},{"time":0.7,"touch":[{"x":35,"y":83},{"x":285,"y":333}]},{"time":0.8999999999999999,"touch":[{"x":100,"y":196},{"x":520,"y":616}]}])

info: [debug] [INST] 2014-12-07 04:40:40 +0000 Debug: target.touch(__NSCFArray)

info: [IOS_SYSLOG_ROW ] Dec 7 12:40:41 sujiande-iPhone MobileGestaltHelper[79] : libMobileGestalt MobileGestalt.c:273: server_access_check denied access to question UniqueDeviceID for pid 1356

info: [IOS_SYSLOG_ROW ] Dec 7 12:40:41 sujiande-iPhone ScriptAgent[1356] : libMobileGestalt MobileGestaltSupport.m:170: pid 1356 (ScriptAgent) does not have sandbox access for re6Zb+zwFKJNlkQTUeT+/w and IS NOT appropriately entitled

info: [IOS_SYSLOG_ROW ] Dec 7 12:40:41 sujiande-iPhone ScriptAgent[1356] : libMobileGestalt MobileGestalt.c:534: no access to UniqueDeviceID (see rdar://problem/11744455)
info: [debug] [INST] 2014-12-07 04:40:41 +0000 Debug: point is not within the bounds of the screen

info: [debug] [INST] 2014-12-07 04:40:41 +0000 Error: VerboseError: point is not within the bounds of the screen

info: [debug] Socket data received (70 bytes)

info: [debug] Socket data being routed.
info: [debug] Got result from instruments: {"status":17,"value":"point is not within the bounds of the screen"}
info: [debug] Responding to client with error: {"status":17,"value":{"message":"An error occurred while executing user supplied JavaScript.","origValue":"point is not within the bounds of the screen"},"sessionId":"2debc140-5e74-48d3-adea-a3b9b40463fd"}
info: <-- POST /wd/hub/session/2debc140-5e74-48d3-adea-a3b9b40463fd/touch/multi/perform 500 1937.891 ms - 205
info: --> DELETE /wd/hub/session/2debc140-5e74-48d3-adea-a3b9b40463fd {}
info: Shutting down appium session
info: [debug] Stopping ios
info: [debug] Destroying instruments client socket.
info: [debug] Closing socket server.
info: [debug] Instruments socket server was closed
info: [debug] Sending sigterm to instruments
info: [debug] [INST] 2014-12-07 04:40:41 +0000 Stopped: Script was stopped by the user
info: [IOS_SYSLOG_ROW ] Dec 7 12:40:41 sujiande-iPhone locationd[56] : Gesture EnabledForTopCLient: 0, EnabledInDaemonSettings: 0
info: [IOS_SYSLOG_ROW ] Dec 7 12:40:41 sujiande-iPhone locationd[56] : Gesture EnabledForTopCLient: 0, EnabledInDaemonSettings: 0
info: [IOS_SYSLOG_ROW ] Dec 7 12:40:41 sujiande-iPhone SpringBoard[49] : Unable to get short BSD proc info for 1355: No such process
info: [IOS_SYSLOG_ROW ] Dec 7 12:40:41 sujiande-iPhone SpringBoard[49] : Unable to get short BSD proc info for 1355: No such process
info: [IOS_SYSLOG_ROW ] Dec 7 12:40:41 sujiande-iPhone SpringBoard[49] : Unable to get short BSD proc info for 1355: No such process
info: [IOS_SYSLOG_ROW ] Dec 7 12:40:41 sujiande-iPhone com.apple.xpc.launchd1 : Service exited due to signal: Killed: 9

info: [debug] [INST] 2014-12-07 04:40:41 +0000 Error: Error during eval: touch@[native code]
eval code
eval@[native code]
startProcessing@file:///Applications/Appium.app/Contents/Resources/node_modules/appium/2A7BDB42-509D-49AB-AD5E-D1C81977C236/bootstrap-0943baae6b1d6f5b.js:2663:30
bootstrap@file:///Applications/Appium.app/Contents/Resources/node_modules/appium/2A7BDB42-509D-49AB-AD5E-D1C81977C236/bootstrap-0943baae6b1d6f5b.js:2729:31
global code@file:///Applications/Appium.app/Contents/Resources/node_modules/appium/2A7BDB42-509D-49AB-AD5E-D1C81977C236/bootstrap-0943baae6b1d6f5b.js:2738:10
info: [debug] [INST] 2014-12-07 04:40:41 +0000 Debug: responding with:
2014-12-07 04:40:41 +0000 Debug: Running system command #8: /Applications/Appium.app/Contents/Resources/node/bin/node /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-uiauto/bin/command-proxy-client.js /tmp/instruments_sock 2,{"status":17,"value":"point is not within the bounds of the screen"}...

info: [IOS_SYSLOG_ROW ] Dec 7 12:40:41 sujiande-iPhone SpringBoard[49] : Application 'UIKitApplication:io.appium.TestApp[0x3650]' exited abnormally via signal.
info: [IOS_SYSLOG_ROW ] Dec 7 12:40:41 sujiande-iPhone assertiond[59] : pid_suspend failed for : Unknown error: -1, Unknown error: -1
info: [IOS_SYSLOG_ROW ] Dec 7 12:40:41 sujiande-iPhone assertiond[59] : Could not set priority of to 2, priority: No such process
info: [IOS_SYSLOG_ROW ] Dec 7 12:40:41 sujiande-iPhone assertiond[59] : Could not set priority of to 4096, priority: No such process

info: [IOS_SYSLOG_ROW ] Dec 7 12:40:41 sujiande-iPhone backboardd[52] : ALS: SetDisplayFactor: factor=1.0000

info: [debug] [INST] Instruments Trace Complete (Duration : 15.359571s; Output : /tmp/appium-instruments/instrumentscli0.trace)

info: [debug] [INSTSERVER] Instruments exited with code 0
info: [debug] Cleaning up after instruments exit
info: [debug] Stopping iOS log capture
info: [debug] Running ios sim reset flow
info: [debug] Killing the simulator process
info: [debug] Killall iOS Simulator
info: [debug] Killing any other simulator daemons

@bootstraponline
Copy link
Member

What is the window size? That point could simply be outside the bounds. I
think the end point might be an offset instead of an absolute location.

If it's a bug then I'm pretty sure it's in the server not the ruby bindings.
On Dec 12, 2014 4:55 AM, "wensj" notifications@github.com wrote:

server log:

info: [debug] [INST] 2014-12-07 04:40:39 +0000 Debug: Got new command 6
from instruments: au.getElementByIndexPath('/0/0/0')

info: [debug] [INST] 2014-12-07 04:40:39 +0000 Debug: evaluating
au.getElementByIndexPath('/0/0/0')

info: [debug] [INST] 2014-12-07 04:40:39 +0000 Debug: evaluation finished
info: [debug] [INST] 2014-12-07 04:40:39 +0000 Debug: responding with:
info: [debug] [INST] 2014-12-07 04:40:39 +0000 Debug: Running system
command #7 #7:
/Applications/Appium.app/Contents/Resources/node/bin/node
/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-uiauto/bin/command-proxy-client.js
/tmp/instruments_sock 2,{"status":0,"value":{"ELEMENT":"1"}}...

info: [debug] Socket data received (38 bytes)
info: [debug] Socket data being routed.
info: [debug] Got result from instruments:
{"status":0,"value":{"ELEMENT":"1"}}
info: [debug] Responding to client with success:
{"status":0,"value":{"ELEMENT":"1"},"sessionId":"2debc140-5e74-48d3-adea-a3b9b40463fd"}
info: <-- POST
/wd/hub/session/2debc140-5e74-48d3-adea-a3b9b40463fd/element 200 2311.527
ms - 87
{"status":0,"value":{"ELEMENT":"1"},"sessionId":"2debc140-5e74-48d3-adea-a3b9b40463fd"}
info: --> POST
/wd/hub/session/2debc140-5e74-48d3-adea-a3b9b40463fd/touch/multi/perform
{"actions":[[{"action":"press","options":{"x":35,"y":83}},{"action":"wait","options":{"ms":500}},{"action":"moveTo","options":{"x":65,"y":113}},{"action":"release"}],[{"action":"press","options":{"x":285,"y":333}},{"action":"wait","options":{"ms":500}},{"action":"moveTo","options":{"x":235,"y":283}},{"action":"release"}]]}
info: [debug] Pushing command to appium work queue:
"target.touch([{"time":0.2,"touch":[{"x":35,"y":83},{"x":285,"y":333}]},{"time":0.7,"touch":[{"x":35,"y":83},{"x":285,"y":333}]},{"time":0.8999999999999999,"touch":[{"x":100,"y":196},{"x":520,"y":616}]}])"
info: [debug] Sending command to instruments:
target.touch([{"time":0.2,"touch":[{"x":35,"y":83},{"x":285,"y":333}]},{"time":0.7,"touch":[{"x":35,"y":83},{"x":285,"y":333}]},{"time":0.8999999999999999,"touch":[{"x":100,"y":196},{"x":520,"y":616}]}])

info: [debug] [INST] 2014-12-07 04:40:40 +0000 Debug: Got new command 7
from instruments:
target.touch([{"time":0.2,"touch":[{"x":35,"y":83},{"x":285,"y":333}]},{"time":0.7,"touch":[{"x":35,"y":83},{"x":285,"y":333}]},{"time":0.8999999999999999,"touch":[{"x":100,"y":196},{"x":520,"y":616}]}])

info: [debug] [INST] 2014-12-07 04:40:40 +0000 Debug: evaluating
target.touch([{"time":0.2,"touch":[{"x":35,"y":83},{"x":285,"y":333}]},{"time":0.7,"touch":[{"x":35,"y":83},{"x":285,"y":333}]},{"time":0.8999999999999999,"touch":[{"x":100,"y":196},{"x":520,"y":616}]}])

info: [debug] [INST] 2014-12-07 04:40:40 +0000 Debug:
target.touch(__NSCFArray)

info: [IOS_SYSLOG_ROW ] Dec 7 12:40:41 sujiande-iPhone
MobileGestaltHelper[79] : libMobileGestalt MobileGestalt.c:273:
server_access_check denied access to question UniqueDeviceID for pid 1356

info: [IOS_SYSLOG_ROW ] Dec 7 12:40:41 sujiande-iPhone ScriptAgent[1356] :
libMobileGestalt MobileGestaltSupport.m:170: pid 1356 (ScriptAgent) does
not have sandbox access for re6Zb+zwFKJNlkQTUeT+/w and IS NOT appropriately
entitled

info: [IOS_SYSLOG_ROW ] Dec 7 12:40:41 sujiande-iPhone ScriptAgent[1356] :
libMobileGestalt MobileGestalt.c:534: no access to UniqueDeviceID (see
rdar://problem/11744455)
info: [debug] [INST] 2014-12-07 04:40:41 +0000 Debug: point is not within
the bounds of the screen

info: [debug] [INST] 2014-12-07 04:40:41 +0000 Error: VerboseError: point
is not within the bounds of the screen

info: [debug] Socket data received (70 bytes)

info: [debug] Socket data being routed.
info: [debug] Got result from instruments: {"status":17,"value":"point is
not within the bounds of the screen"}
info: [debug] Responding to client with error:
{"status":17,"value":{"message":"An error occurred while executing user
supplied JavaScript.","origValue":"point is not within the bounds of the
screen"},"sessionId":"2debc140-5e74-48d3-adea-a3b9b40463fd"}
info: <-- POST
/wd/hub/session/2debc140-5e74-48d3-adea-a3b9b40463fd/touch/multi/perform
500 1937.891 ms - 205
info: --> DELETE /wd/hub/session/2debc140-5e74-48d3-adea-a3b9b40463fd {}
info: Shutting down appium session
info: [debug] Stopping ios
info: [debug] Destroying instruments client socket.
info: [debug] Closing socket server.
info: [debug] Instruments socket server was closed
info: [debug] Sending sigterm to instruments
info: [debug] [INST] 2014-12-07 04:40:41 +0000 Stopped: Script was stopped
by the user
info: [IOS_SYSLOG_ROW ] Dec 7 12:40:41 sujiande-iPhone locationd[56] :
Gesture EnabledForTopCLient: 0, EnabledInDaemonSettings: 0
info: [IOS_SYSLOG_ROW ] Dec 7 12:40:41 sujiande-iPhone locationd[56] :
Gesture EnabledForTopCLient: 0, EnabledInDaemonSettings: 0
info: [IOS_SYSLOG_ROW ] Dec 7 12:40:41 sujiande-iPhone SpringBoard[49] :
Unable to get short BSD proc info for 1355: No such process
info: [IOS_SYSLOG_ROW ] Dec 7 12:40:41 sujiande-iPhone SpringBoard[49] :
Unable to get short BSD proc info for 1355: No such process
info: [IOS_SYSLOG_ROW ] Dec 7 12:40:41 sujiande-iPhone SpringBoard[49] :
Unable to get short BSD proc info for 1355: No such process
info: [IOS_SYSLOG_ROW ] Dec 7 12:40:41 sujiande-iPhone
com.apple.xpc.launchd1 : Service exited due to signal: Killed: 9

info: [debug] [INST] 2014-12-07 04:40:41 +0000 Error: Error during eval:
touch@[native code]
eval code
eval@[native code]
startProcessing
@file:///Applications/Appium.app/Contents/Resources/node_modules/appium/2A7BDB42-509D-49AB-AD5E-D1C81977C236/bootstrap-0943baae6b1d6f5b.js:2663:30
bootstrap
@file:///Applications/Appium.app/Contents/Resources/node_modules/appium/2A7BDB42-509D-49AB-AD5E-D1C81977C236/bootstrap-0943baae6b1d6f5b.js:2729:31
global code
@file:///Applications/Appium.app/Contents/Resources/node_modules/appium/2A7BDB42-509D-49AB-AD5E-D1C81977C236/bootstrap-0943baae6b1d6f5b.js:2738:10
info: [debug] [INST] 2014-12-07 04:40:41 +0000 Debug: responding with:
2014-12-07 04:40:41 +0000 Debug: Running system command #8
#8:
/Applications/Appium.app/Contents/Resources/node/bin/node
/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-uiauto/bin/command-proxy-client.js
/tmp/instruments_sock 2,{"status":17,"value":"point is not within the
bounds of the screen"}...

info: [IOS_SYSLOG_ROW ] Dec 7 12:40:41 sujiande-iPhone SpringBoard[49] :
Application 'UIKitApplication:io.appium.TestApp[0x3650]' exited abnormally
via signal.
info: [IOS_SYSLOG_ROW ] Dec 7 12:40:41 sujiande-iPhone assertiond[59] :
pid_suspend failed for : Unknown error: -1, Unknown error: -1
info: [IOS_SYSLOG_ROW ] Dec 7 12:40:41 sujiande-iPhone assertiond[59] :
Could not set priority of to 2, priority: No such process
info: [IOS_SYSLOG_ROW ] Dec 7 12:40:41 sujiande-iPhone assertiond[59] :
Could not set priority of to 4096, priority: No such process

info: [IOS_SYSLOG_ROW ] Dec 7 12:40:41 sujiande-iPhone backboardd[52] :
ALS: SetDisplayFactor: factor=1.0000

info: [debug] [INST] Instruments Trace Complete (Duration : 15.359571s;
Output : /tmp/appium-instruments/instrumentscli0.trace)

info: [debug] [INSTSERVER] Instruments exited with code 0
info: [debug] Cleaning up after instruments exit
info: [debug] Stopping iOS log capture
info: [debug] Running ios sim reset flow
info: [debug] Killing the simulator process
info: [debug] Killall iOS Simulator
info: [debug] Killing any other simulator daemons


Reply to this email directly or view it on GitHub
#293 (comment).

@ryanwyu
Copy link

ryanwyu commented Jul 13, 2016

This issue has not been solved even in 8.0.2 release version, which costed us one whole day to find out this issue.

The new appium server need the client to use the end_x and end_y to get the offset when sending to the server, why the client just sends the end_x, end_y to server. As suggested above, when we use the swipe method, we should treat end_x and end_y as offset_x and offset_y.

Hope it can be solved in new version.

@KazuCocoa KazuCocoa changed the title rename end_x and end_y to offset_x and offset_y rename end_x and end_y to delta_x and delta_y Nov 17, 2016
@KazuCocoa
Copy link
Member

rename end_ to delta_ is included in https://rubygems.org/gems/appium_lib/versions/8.1.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants