Calabash-ios:尝试查询对象 ID 的列表并在结果中得到“*****”
Calabash-ios: Trying to query for the objects id's list and get "*****" in the result
在 calabash-android 中,命令 query(“*”,:id)
returns 带有对象 ID 内容的列表(空 ID 将 return: nil)。
但是,在 calabash-ios 中,相同的命令 return 和 “*****”
的列表(下面的示例)。
整个列表都是这样,甚至有些id是有内容的。
`irb(main):033:0> query("*",:id)
[
[ 0] "*****",
[ 1] "*****",
[ 2] "*****",
[ 3] "*****",
[ 4] "*****",
[ 5] "*****",
[ 6] "*****",
[ 7] "*****",
[ 8] "*****",`
如果我 运行 命令:query("* id:'next_arrow'")
我得到的结果如下:
`[5] {
"alpha" => 1,
"enabled" => false,
"id" => "next_arrow",
"visible" => 1,
"frame" => {
"y" => 0,
"x" => 0,
"width" => 15,
"height" => 15
},
"accessibilityElement" => false,
"class" => "UIImageView",
"label" => nil,
"description" => "<UIImageView: 0x7ffda8a6d3c0; frame = (0 0; 15 15); clipsToBounds = YES; opaque = NO; userInteractionEnabled = NO; layer = <CALayer: 0x7ffda8a6c1f0>> - (null)",
"value" => nil,
"rect" => {
"y" => 386.5,
"center_x" => 18.16,
"center_y" => 461.72,
"x" => 8,
"width" => 15,
"height" => 15
}
}
我希望在 运行 时看到列表中的 "next_arrow":query("*",:id)
。
当我运行执行命令时没有问题query(“*”,:text)
我 运行 在 iOS 9.0 模拟器上安装它。
我的查询语法有什么问题?
query("*",:id)
您应该这样理解:
"Find all visible views and call the id
selector on each one"。
由于 id
不是 UIView 上的 Objective-C 选择器,您返回“*****”,这意味着 "the view does not respond to selector".
你可以试试这个:
查询(“*”,:accessibilityIdentifier)
这是我得到的示例列表:
[ 0] nil,
[ 1] nil,
[ 2] nil,
[ 3] nil,
[ 4] nil,
[ 5] nil,
[ 6] nil,
[ 7] "dashboard_page",
[ 8] nil,
[ 9] nil,
[ 10] nil,
[ 11] "home_summary_background",
[ 12] nil,
在 calabash-android 中,命令 query(“*”,:id)
returns 带有对象 ID 内容的列表(空 ID 将 return: nil)。
但是,在 calabash-ios 中,相同的命令 return 和 “*****”
的列表(下面的示例)。
整个列表都是这样,甚至有些id是有内容的。
`irb(main):033:0> query("*",:id)
[
[ 0] "*****",
[ 1] "*****",
[ 2] "*****",
[ 3] "*****",
[ 4] "*****",
[ 5] "*****",
[ 6] "*****",
[ 7] "*****",
[ 8] "*****",`
如果我 运行 命令:query("* id:'next_arrow'")
我得到的结果如下:
`[5] {
"alpha" => 1,
"enabled" => false,
"id" => "next_arrow",
"visible" => 1,
"frame" => {
"y" => 0,
"x" => 0,
"width" => 15,
"height" => 15
},
"accessibilityElement" => false,
"class" => "UIImageView",
"label" => nil,
"description" => "<UIImageView: 0x7ffda8a6d3c0; frame = (0 0; 15 15); clipsToBounds = YES; opaque = NO; userInteractionEnabled = NO; layer = <CALayer: 0x7ffda8a6c1f0>> - (null)",
"value" => nil,
"rect" => {
"y" => 386.5,
"center_x" => 18.16,
"center_y" => 461.72,
"x" => 8,
"width" => 15,
"height" => 15
}
}
我希望在 运行 时看到列表中的 "next_arrow":query("*",:id)
。
当我运行执行命令时没有问题query(“*”,:text)
我 运行 在 iOS 9.0 模拟器上安装它。
我的查询语法有什么问题?
query("*",:id)
您应该这样理解:
"Find all visible views and call the id
selector on each one"。
由于 id
不是 UIView 上的 Objective-C 选择器,您返回“*****”,这意味着 "the view does not respond to selector".
你可以试试这个:
查询(“*”,:accessibilityIdentifier)
这是我得到的示例列表:
[ 0] nil,
[ 1] nil,
[ 2] nil,
[ 3] nil,
[ 4] nil,
[ 5] nil,
[ 6] nil,
[ 7] "dashboard_page",
[ 8] nil,
[ 9] nil,
[ 10] nil,
[ 11] "home_summary_background",
[ 12] nil,