有没有办法确定是否在webView中选中了复选框?
以下是remember_me checkbox
的查询value
未发生变化,因为这是随表单提交的值。
有什么想法吗?
irb(main):032:0> query("webView css:'#remember_me'")
[
[0] {
"class" => "",
"nodeType" => "ELEMENT_NODE",
"id" => "remember_me",
"textContent" => "",
"html" => "<input type=\"checkbox\" id=\"remember_me\" value=\"1\" name=\"rm\">",
"rect" => {
"bottom" => 191,
"y" => 609,
"right" => 23,
"x" => 30,
"center_x" => 48,
"width" => 39,
"height" => 39,
"top" => 178,
"left" => 10,
"center_y" => 627
},
"value" => "1",
"nodeName" => "INPUT",
"webView" => "webview"
}
]
答案 0 :(得分:1)
Calabash-Android目前不支持使用查询语法在webview元素上调用方法。但是,您可以在webview中调用javascript来获得结果。
evaluate_javascript("webView", "return document.getElementById('remember_me').checked;")