如何使用ruby和watir单击隐藏的复选框和/或更改隐藏元素的值(从“2”到“1”)?更改隐藏元素的值
的HTML
[div class="spec"]
[span class="listheader"]Rechtsgebieden[/span]
[div]
[span class="legalarea" style="cursor:default" onmouseout="hlt(this,false);" onmouseover="hlt(this,true);" ondblclick="call(this, '.legalarea');" onclick="call(this, '.legalarea');"]
[table id="ctl00_cphMC_SS_eJuris_fltrJurLegalArea_cbt" border="0"] [/table]
[/div]
[span class="legalarea-root " style="cursor:default" onmouseout="hlt(this,false);" onmouseover="hlt(this,true);"]
[div id="ctl00_cphMC_SS_eJuris_fltrJurLegalArea_qwtA105qwausqwt_pu" class="CheckboxValuePopup" style="display:none;position:absolute;" name="ctl00-cphMC-SS-eJuris-fltrJurLegalArea-qwtA105qwausqwt-pu"] [/div]
[span class="legalarea-root " style="cursor:default" onmouseout="hlt(this,false);" onmouseover="hlt(this,true);"]
[input id="ctl00_cphMC_SS_eJuris_fltrJurLegalArea_qwtA109qwausqwt_cb_cv" type="hidden" value="2" name="ctl00$cphMC$SS$eJuris$fltrJurLegalArea$qwtA109qwausqwt$cb_cv"]
[img ondblclick="CheckBox(this, '.ctl00-cphMC-SS-eJuris-fltrJurLegalArea-qwtA109qwausqwt-pu', true);" onclick="CheckBox(this, '.ctl00-cphMC-SS-eJuris-fltrJurLegalArea-qwtA109qwausqwt-pu', true);" src="http://portal.rechtsorde.nl/img/2.png"]
[a class="search-filter-link" onclick="$('.ctl00-cphMC-SS-eJuris-fltrJurLegalArea-qwtA109qwausqwt-pu').dialog('open'); callerID=this;"]Handels- en ondernemingsrecht[/a]
工程,以访问该元素的代码/查找值:
browser.hidden(:name, /A111/)first.value
请考虑清理提供的html - (1)html应该使用< and >,而不是[和]; (2)某些元素似乎嵌套不正确或缺少各自的打开/关闭标记,这可能表明html缺失; (3)没有名称为/ A111 /的隐藏元素,它看起来像是动态生成的数字。 – 2013-02-21 17:33:09
会做!谢谢 – Seeb 2013-02-22 11:34:10