【发布时间】:2016-03-17 21:54:38
【问题描述】:
我正在尝试在我的原生应用中获取切换开关的状态。
这是开关本身的查询,当ON时:
query "Switch id:'quadrant_buzz'"
及其结果
[
[0] {
"class" => "android.widget.Switch",
"tag" => nil,
"description" => "android.widget.Switch{29ddf658 VFED..C. ........ 877,0-1017,81 #7f10017f app:id/quadrant_buzz}",
"id" => "quadrant_buzz",
"text" => "",
"visible" => true,
"rect" => {
"height" => 81,
"width" => 140,
"y" => 1303,
"x" => 877,
"center_x" => 947,
"center_y" => 1343
},
"enabled" => true,
"contentDescription" => nil
}]
这是开关关闭时的查询结果:
[
[0] {
"class" => "android.widget.Switch",
"tag" => nil,
"description" => "android.widget.Switch{29ddf658 VFED..C. ........ 877,0-1017,81 #7f10017f app:id/quadrant_buzz}",
"id" => "quadrant_buzz",
"text" => "",
"visible" => true,
"rect" => {
"height" => 81,
"width" => 140,
"y" => 1213,
"x" => 877,
"center_x" => 947,
"center_y" => 1253
},
"enabled" => true,
"contentDescription" => nil
}]
我不确定如何检查其开/关状态。当我点击/触摸开关时,返回的查询没有任何变化。我看到的唯一区别是中心 Y。
Calabash Api 中有什么东西吗?
谢谢
【问题讨论】:
标签: calabash calabash-ios calabash-android