Open kristinaste opened 8 years ago
# Incorrect
device_agent.query({type: "button"})
# Correct
device_agent.query({type: "Button"})
type: "TextField"
Why are you mentioning TextField
in this context?
Because it is an example usage I've seen on the wikipage https://github.com/calabash/calabash-ios/wiki/DeviceAgent
I've tried also with Button, but the result is the same, I can not select the second query result
calabash-ios 0.20.0> device_agent.query({type: "Button"})
DEBUG: HTTP: get http://192.168.2.5:27753/1.0/health {:retries=>1, :timeout=>0.5}
DEBUG: DeviceAgent says, "Calabash is ready and waiting."
DEBUG: Sending query with parameters:
{
"type": "Button"
}
DEBUG: HTTP: post http://192.168.2.5:27753/1.0/query {:retries=>100, :timeout=>10}
[
[0] {
"enabled" => true,
"id" => "Cancelar",
"hitable" => true,
"rect" => {
"y" => 342,
"x" => 52.5,
"height" => 44,
"width" => 135
},
"label" => "Cancelar",
"type" => "Button",
"hit_point" => {
"x" => 120,
"y" => 364
},
"test_id" => 479
},
[1] {
"enabled" => true,
"id" => "Vaciar",
"hitable" => true,
"rect" => {
"y" => 342,
"x" => 187.5,
"height" => 44,
"width" => 135
},
"label" => "Vaciar",
"type" => "Button",
"hit_point" => {
"x" => 255,
"y" => 364
},
"test_id" => 481
}
]
calabash-ios 0.20.0> device_agent.query({type: "Button", index:1})
DEBUG: HTTP: get http://192.168.2.5:27753/1.0/health {:retries=>1, :timeout=>0.5}
DEBUG: DeviceAgent says, "Calabash is ready and waiting."
DEBUG: Sending query with parameters:
{
"type": "Button",
"index": 1
}
DEBUG: HTTP: post http://192.168.2.5:27753/1.0/query {:retries=>100, :timeout=>10}
[]
Is this a Privacy alert or an alert that this presented by SpringBoard (update iOS version, no SIM card, etc.)?
Or is this an alert that your application is presenting?
It is an alert my application shows, before I was using uia('target.frontMostApp().alert().defaultButton().tap();') and uia('target.frontMostApp().alert().cancelButton().tap();') to be able to press both alert buttons
I will investigate.
However, you should not need to use DeviceAgent at all - the Core#query
and Core#touch
methods should work if this is an alert that is not presented by SpringBoard.
touch("* marked:'Cancelar'")
@sbalajieie I have removed you comment because it did not relate to this issue.
Reproduced.
@jescriba This would be a good one to investigate in DeviceAgent.
@jmoody I haven't been able to reproduce this on the latest device agent with UIAlertView
s from the smoke-test-app.
Hi, I'm struggling to adapt my test to Xcode 8 with Device Agent. I'm trying to touch an alert button with Device Agent, but when there are more than one button, it only manages to touch/query the first one.
It looks like the index part in
device_agent.query({type: "TextField", index:1})
doesn't work