Webdriveragent: How can I slide the screen

Created on 9 Jan 2017  ·  14Comments  ·  Source: facebookarchive/WebDriverAgent

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

Most helpful comment

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

All 14 comments

@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

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

@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

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

Cheers

@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

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

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 :)

@VasilijSviridov Thank you . I try to do that.

@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.

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)

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

@AlexJinsin really hope this will help :)

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

Was this page helpful?
0 / 5 - 0 ratings