Skip to content
This repository has been archived by the owner on Dec 26, 2019. It is now read-only.

How can I slide the screen #441

Closed
AlexJinsin opened this issue Jan 9, 2017 · 14 comments
Closed

How can I slide the screen #441

AlexJinsin opened this issue Jan 9, 2017 · 14 comments

Comments

@AlexJinsin
Copy link

I wanna slide the screen .
which API should i use?

@VasilijSviridov
Copy link

use this one : curl -X POST $JSON_HEADER -d "{fromX:187,fromY:660,toX:0,toY:660,duration:800}" yourhost:port/session/SESSION_ID/uiaTarget/0/dragfromtoforduration

@AlexJinsin
Copy link
Author

AlexJinsin commented Jan 10, 2017

@VasilijSviridov
I have try this
'curl -X POST $JSON_HEADER -d "{fromX:300,fromY:360,toX:0,toY:360,duration:400}" $DEVICE_URL/session/$SESSION_ID/uiaTarget/0/dragfromtoforduration'
but it do not work in simulator

@marekcirkos
Copy link
Contributor

Are you sure you have right coordinates?
Just out of curiosity what are you trying to slide?

@AlexJinsin
Copy link
Author

AlexJinsin commented Jan 10, 2017

@marekcirkos
I have used this command "curl -X POST $JSON_HEADER -d "{fromX:187,fromY:660,toX:0,toY:660,duration:800}" yourhost:port/session/SESSION_ID/uiaTarget/0/dragfromtoforduration".
But I'm not sure how to use coordinates , and “uiaTarget/0” I don't know what's that mean.
The '0' should I change?

I just want to slide in the homescreen left or right

@VasilijSviridov
Copy link

@AlexJinsin works on my side with real device. Try to check what are you trying to slide and which directions.

Cheers

@AlexJinsin
Copy link
Author

@VasilijSviridov
I am real device too. With that command , if I just need change "fromX","fromY","toX","toY"and"duration" parameter is ok?
Do I need change "uiaTarget/0/dragfromtoforduration"?
I am a novice . Could you give me more proposal? Thank you

@VasilijSviridov
Copy link

Sorry @AlexJinsin
Try this one, should slide down :
curl -X POST $JSON_HEADER -d "{"fromX":"187.00","fromY":"460","toX":"87.00","toY":"60","duration":"0.10"}" host:port/session/SESSION_ID/uiaTarget/0/dragfromtoforduration

@VasilijSviridov
Copy link

Also I noticed that github removes all "" - slash signs, so this is not only copy paste from here :)

Hopefully you will figure it out @AlexJinsin :)

@AlexJinsin
Copy link
Author

@VasilijSviridov Thank you . I try to do that.

@AlexJinsin
Copy link
Author

@VasilijSviridov
comman like this:
alexmatoiMac:~ alex$ curl -X POST $JSON_HEADER -d "{"fromX":"187.00","from":"460","toX":"187.00","toY":"60","duration":"0.10"}" $DEVICE_URL/session/$SESSION_ID/uiaTarget/0/dragfromtoforduration
{
"value" : {

},
"sessionId" : "7F606C7E-FD45-4ABB-935A-BD43C2F039FE",
"status" : 0
}alexmatoiMac:~ alex$

log like this:
t = 1153.63s Find the Application "local.pid.248" 0x14f10b7c0
t = 1153.64s Snapshot accessibility hierarchy for local.pid.248
t = 1154.00s Find the Application "local.pid.248" 0x14f10b7c0
t = 1154.00s Use cached accessibility hierarchy for local.pid.248
t = 1154.06s Press and drag from Application "local.pid.248" 0x14f10b7c0[0.00, 0.00] -> (0.0, 0.0) to Application "local.pid.248" 0x14f10b7c0[0.00, 0.00] -> (0.0, 0.0)
t = 1154.06s Wait for app to idle
t = 1154.17s Find the Application "local.pid.248" 0x14f10b7c0
t = 1154.17s Snapshot accessibility hierarchy for local.pid.248
t = 1154.52s Wait for app to idle
t = 1154.61s App event loop idle notification not received, will attempt to continue.
t = 1154.62s App animations complete notification not received, will attempt to continue.
t = 1154.63s Synthesize event
t = 1154.72s Find the Application "local.pid.248" 0x14f10b7c0
t = 1154.72s Snapshot accessibility hierarchy for local.pid.248
t = 1155.05s Find the Application "local.pid.248" 0x14f10b7c0
t = 1155.05s Use cached accessibility hierarchy for local.pid.248
t = 1155.19s Wait for app to idle

The screen still not move.

@VasilijSviridov
Copy link

Are you using slashes in parameters ?
As I can see you still posting without slashes :
t = 1154.06s Press and drag from Application "local.pid.248" 0x14f10b7c0[0.00, 0.00] -> (0.0, 0.0) to Application "local.pid.248" 0x14f10b7c0[0.00, 0.00] -> (0.0, 0.0)

@VasilijSviridov
Copy link

github removed all back slashes from my post so basically it should be like this : [backslash]"fromX[backslash]":[backslash]"187.00[backslash]"

@VasilijSviridov
Copy link

@AlexJinsin really hope this will help :)

@AlexJinsin
Copy link
Author

AlexJinsin commented Jan 11, 2017

@VasilijSviridov
I get the point . It worked. Thanks a lot! You finished my problem.

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

No branches or pull requests

3 participants