我正在尝试与另一个元素下面的页面上的元素进行交互,但是已隐藏。 calabash查询返回正确的元素。 Tap似乎与元素交互,因为我没有向我抛出任何错误并返回页面元素。但是,我可以用手指触摸应用程序上的元素并且它可以正常工作。
有没有办法引用某种z索引,或者与元素交互的替代方法?
注意:带有混合应用程序(离子)的Calabash 2.0.0.pre4
由于
抱歉,我尝试与之交互的元素是可见的。 这是我的查询:
query "webView css:'#btn_get_a_quote'"
[
[0] {
"center" => {
"X" => 186.80419921875,
"Y" => 538.7015104293824
},
"webView" => "<UIWebView: 0x154e6ed70; frame = (0 0; 320 568); autoresize = W+H; layer = <CALayer: 0x154e6d8c0>>",
"nodeName" => "LI",
"id" => "btn_get_a_quote",
"textContent" => "\n\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\tGet a Quote\n\t\t\t\t\t\n\t\t\t\t",
"class" => "btn-icon in",
"rect" => {
"x" => 186.8042,
"height" => 67.1875,
"y" => 538.7015,
"width" => 67.1875,
"left" => 126.40625,
"top" => 426.69195556640625,
"center_y" => 538.7015,
"center_x" => 186.8042
},
"nodeType" => "ELEMENT_NODE"
}
]
这是我的点击:
tap "webView css:'#btn_get_a_quote'"
Getting: http://iphone6-27.local:37265/map {}
[
[0] {
"center" => {
"X" => 186.80419921875,
"Y" => 538.7015104293824
},
"webView" => "<UIWebView: 0x155534d90; frame = (0 0; 320 568); autoresize = W+H; layer = <CALayer: 0x15554d470>>",
"nodeName" => "LI",
"id" => "btn_get_a_quote",
"textContent" => "\n\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\tGet a Quote\n\t\t\t\t\t\n\t\t\t\t",
"class" => "btn-icon in",
"rect" => {
"x" => 186.8042,
"height" => 67.1875,
"y" => 538.7015,
"width" => 67.1875,
"left" => 126.40625,
"top" => 426.69195556640625,
"center_y" => 538.7015,
"center_x" => 186.8042
},
"nodeType" => "ELEMENT_NODE"
}
]
点击元素应该带你到另一个页面,并在我实际操作时工作。
答案 0 :(得分:0)
我正在尝试与另一个元素下面的页面上的元素进行交互,但是隐藏了
在评论中,您说元素在屏幕上可见。隐藏的是什么意思?
&#34; webView css:&#39;#btn_log_in&#39;&#34;
这是查询吗?如果没有,您可以粘贴实际查询吗?屏幕截图也可能有用。
至于你的问题,你见过WebView API吗?也许xpath或javascript查询可以帮到你?