這不是一個真正的寧靜問題,但接近Selenium。Serenity BDD(Selenium,JUnit,Maven,IEDriver64):勾選複選框不會啓用底層選項
當測試運行時,它會檢查該頁面上可見的複選框,並且該功能期望一旦選中該複選框,該基礎選項就可見。
然而,測試運行不選中該複選框,但是,基本的選項是不可見的。
當我在它上面放置一個斷點並手動執行時,它按預期完美工作。另外,有趣的是,如果自動化腳本檢查複選框,並且我再次使用腳本調試器取消選中複選框,則底層選項將變爲可見,並且複選框未被選中 - 奇怪,不是嗎?
這可能是什麼可能的原因?
任何幫助,將不勝感激。
代碼塊:
Case.chkbxNewPolicy.click(); //Here it selects the checkbox
Case.selectEntityType.selectByVisibleText(param.get("CaseType").toString()); //Here it is expected to enable the underlying objects
Case.editNewPolicyNum.type(param.get("PolicyNo").toString());
Case.editAdviserId.type(param.get("AdviserId").toString());
// HTML
</div>
<div id="createNewContainer" G360ComponentSpec="type:AdjustableContainer;fs:f;dc:f;cl:f;ic:f;" G360LayoutSpec="l:4;lip:t;lif:f;t:28;tip:t;tif:f;r:142;riw:t;rip:t;rif:f;ra:+-;b:23;bih:t;bip:t;bif:f;ba:+-;o:auto;lbpx:4;tbpx:28;wbpx:142;hbpx:23;efwpx:0;"
style="position:absolute; left:4px; top:28px; width:142px; height:23px; overflow:auto;">
<div id="component_25" G360ComponentSpec="type:FieldComponent;dt:1;format:input;fh:CheckBox;" G360LayoutSpec="l:0;lip:t;lif:f;t:2;tip:t;tif:f;r:135;riw:t;rip:t;rif:t;ra:+-;b:20;bih:t;bip:t;bif:t;ba:+-;o:hidden;lbpx:0;tbpx:2;wbpx:135;hbpx:20;efwpx:0;"
style="position:absolute; left:0px; top:2px; width:135px; height:20px; overflow:hidden;"><span class="fielderror" id="IS_NEWPOLICYerror"></span>
<input name="IS_NEWPOLICY" id="IS_NEWPOLICY" type="checkbox" value="true" onclick="displayPolicyEntry(this)" onchange="setDirtyFlag(true,this);">Create New Policy
<input type="hidden" name="IS_NEWPOLICYoriginal" id="IS_NEWPOLICYoriginal" value="false" />
<input type="hidden" name="IS_NEWPOLICYsemaphore" id="IS_NEWPOLICYsemaphore" value="write" />
<input type="hidden" name="IS_NEWPOLICYformatter" id="IS_NEWPOLICYformatter" value="Check Box:label=Create New Policy" />
</div>
</div>
<div id="SELECT_POLICY_DETAILS" G360ComponentSpec="type:AdjustableContainer;fs:f;dc:f;cl:f;ic:f;" G360LayoutSpec="l:9;lip:t;lif:f;t:50;tip:t;tif:f;r:762;riw:t;rip:t;rif:f;ra:+-;b:62;bih:t;bip:t;bif:f;ba:+-;o:auto;lbpx:9;tbpx:50;wbpx:762;hbpx:62;efwpx:0;"
style="position:absolute; left:9px; top:50px; width:762px; height:62px; overflow:auto;">
<div id="component_18" G360ComponentSpec="type:HtmlTextComponent;" G360LayoutSpec="l:25;lip:t;lif:f;t:5;tip:t;tif:f;r:94;riw:t;rip:t;rif:t;ra:+-;b:16;bih:t;bip:t;bif:t;ba:+-;o:hidden;lbpx:25;tbpx:5;wbpx:94;hbpx:16;efwpx:0;" style="background-color:#E6E6E6; position:absolute; left:25px; top:5px; width:94px; height:16px; overflow:hidden;">
<label for="">Policy Number</label>
</div>
<div id="component_19" G360ComponentSpec="type:HtmlTextComponent;" G360LayoutSpec="l:260;lip:t;lif:f;t:5;tip:t;tif:f;r:75;riw:t;rip:t;rif:t;ra:+-;b:16;bih:t;bip:t;bif:t;ba:+-;o:hidden;lbpx:260;tbpx:5;wbpx:75;hbpx:16;efwpx:0;" style="background-color:#E6E6E6; position:absolute; left:260px; top:5px; width:75px; height:16px; overflow:hidden;">
<label for="">Adviser ID</label>
</div>
<div id="component_20" G360ComponentSpec="type:HtmlTextComponent;" G360LayoutSpec="l:350;lip:t;lif:f;t:5;tip:t;tif:f;r:90;riw:t;rip:t;rif:t;ra:+-;b:16;bih:t;bip:t;bif:t;ba:+-;o:hidden;lbpx:350;tbpx:5;wbpx:90;hbpx:16;efwpx:0;" style="background-color:#E6E6E6; position:absolute; left:350px; top:5px; width:90px; height:16px; overflow:hidden;">
<label for="">Adviser Name</label>
</div>
<div id="component_107" G360ComponentSpec="type:HtmlTextComponent;" G360LayoutSpec="l:474;lip:t;lif:f;t:5;tip:t;tif:f;r:70;riw:t;rip:t;rif:t;ra:+-;b:16;bih:t;bip:t;bif:t;ba:+-;o:hidden;lbpx:474;tbpx:5;wbpx:70;hbpx:16;efwpx:0;" style="background-color:#E6E6E6; position:absolute; left:474px; top:5px; width:70px; height:16px; overflow:hidden;">
<label for="">Partner ID</label>
</div>
<div id="component_41" G360ComponentSpec="type:HtmlTextComponent;" G360LayoutSpec="l:565;lip:t;lif:f;t:5;tip:t;tif:f;r:80;riw:t;rip:t;rif:t;ra:+-;b:16;bih:t;bip:t;bif:t;ba:+-;o:hidden;lbpx:565;tbpx:5;wbpx:80;hbpx:16;efwpx:0;" style="background-color:#E6E6E6; position:absolute; left:565px; top:5px; width:80px; height:16px; overflow:hidden;">
<label for="">MP Number</label>
</div>
<div id="component_42" G360ComponentSpec="type:HtmlTextComponent;" G360LayoutSpec="l:654;lip:t;lif:f;t:5;tip:t;tif:f;r:102;riw:t;rip:t;rif:t;ra:+-;b:16;bih:t;bip:t;bif:t;ba:+-;o:hidden;lbpx:654;tbpx:5;wbpx:102;hbpx:16;efwpx:1;" style="background-color:#E6E6E6; position:absolute; left:654px; top:5px; width:102px; height:16px; overflow:hidden;">
<label for="">Fund Member ID</label>
</div>
<div id="container_18" G360ComponentSpec="type:XmlNodeContainer;fs:f;dc:f;cl:f;ic:f;" G360LayoutSpec="l:4;lip:t;lif:f;t:22;tip:t;tif:f;r:753;riw:t;rip:t;rif:f;ra:+-;b:33;bih:t;bip:t;bif:f;ba:+-;o:auto;lbpx:4;tbpx:22;wbpx:753;hbpx:33;efwpx:0;" style="position:absolute; left:4px; top:22px; width:753px; height:33px; overflow:auto;">
</div>
</div>
<div id="NEW_POLICY_DETAILS" G360ComponentSpec="type:AdjustableContainer;fs:f;dc:f;cl:f;ic:f;" G360LayoutSpec="l:4;lip:t;lif:f;t:53;tip:t;tif:f;r:732;riw:t;rip:t;rif:f;ra:+-;b:59;bih:t;bip:t;bif:f;ba:+-;o:auto;lbpx:4;tbpx:53;wbpx:732;hbpx:59;efwpx:35;"
style="position:absolute; left:4px; top:53px; width:732px; height:59px; overflow:auto;">
<div id="component_51" G360ComponentSpec="type:FieldNameComponent;" G360LayoutSpec="l:2;lip:t;lif:t;t:9;tip:t;tif:t;r:72;riw:t;rip:t;rif:t;ra:+-;b:16;bih:t;bip:t;bif:t;ba:+-;o:hidden;lbpx:2;tbpx:9;wbpx:72;hbpx:16;efwpx:46;" style="padding:1px; position:absolute; left:2px; top:9px; width:72px; height:16px; overflow:hidden;">
<label for="ENTITY_TYPE" style="margin-left:1px;margin-right:1px;">Entity Type</label>
</div>
<div id="component_23" G360ComponentSpec="type:FieldNameComponent;" G360LayoutSpec="l:122;lip:t;lif:t;t:9;tip:t;tif:t;r:93;riw:t;rip:t;rif:t;ra:+-;b:16;bih:t;bip:t;bif:t;ba:+-;o:hidden;lbpx:122;tbpx:9;wbpx:93;hbpx:16;efwpx:109;" style="padding:1px; position:absolute; left:122px; top:9px; width:93px; height:16px; overflow:hidden;">
<label for="POLICY_NUM" style="margin-left:1px;margin-right:1px;">Policy Number</label>
</div>
<div id="component_21" G360ComponentSpec="type:FieldNameComponent;" G360LayoutSpec="l:327;lip:t;lif:t;t:9;tip:t;tif:t;r:68;riw:t;rip:t;rif:t;ra:+-;b:16;bih:t;bip:t;bif:t;ba:+-;o:hidden;lbpx:327;tbpx:9;wbpx:68;hbpx:16;efwpx:24;" style="padding:1px; position:absolute; left:327px; top:9px; width:68px; height:16px; overflow:hidden;">
<label for="ADVISER_ID" style="margin-left:1px;margin-right:1px;">Adviser ID</label>
</div>
<div id="component_101" G360ComponentSpec="type:FieldNameComponent;" G360LayoutSpec="l:424;lip:t;lif:f;t:9;tip:t;tif:f;r:68;riw:t;rip:t;rif:t;ra:+-;b:17;bih:t;bip:t;bif:t;ba:+-;o:hidden;lbpx:424;tbpx:9;wbpx:68;hbpx:17;efwpx:116;" style="padding:1px; position:absolute; left:424px; top:9px; width:68px; height:17px; overflow:hidden;">
<label for="PARTNER_ID" style="margin-left:1px;margin-right:1px;">Partner ID</label>
</div>
<div id="component_53" G360ComponentSpec="type:FieldNameComponent;" G360LayoutSpec="l:426;lip:t;lif:t;t:9;tip:t;tif:t;r:173;riw:t;rip:t;rif:t;ra:+-;b:16;bih:t;bip:t;bif:t;ba:+-;o:hidden;lbpx:426;tbpx:9;wbpx:173;hbpx:16;efwpx:9;" style="padding:1px; position:absolute; left:426px; top:9px; width:173px; height:16px; overflow:hidden;">
<label for="FUND_ID" style="margin-left:1px;margin-right:1px;">MP Number</label>
</div>
<div id="component_55" G360ComponentSpec="type:FieldNameComponent;" G360LayoutSpec="l:618;lip:t;lif:t;t:9;tip:t;tif:t;r:102;riw:t;rip:t;rif:t;ra:+-;b:16;bih:t;bip:t;bif:t;ba:+-;o:hidden;lbpx:618;tbpx:9;wbpx:102;hbpx:16;efwpx:11;" style="padding:1px; position:absolute; left:618px; top:9px; width:102px; height:16px; overflow:hidden;">
<label for="FUND_MEMBER_ID" style="margin-left:1px;margin-right:1px;">Fund Member ID</label>
</div>
<div id="component_102" G360ComponentSpec="type:FieldComponent;dt:4;format:input;fh:none;" G360LayoutSpec="l:426;lip:t;lif:f;t:29;tip:t;tif:f;r:94;riw:t;rip:t;rif:t;ra:+-;b:22;bih:t;bip:t;bif:t;ba:+-;o:hidden;lbpx:426;tbpx:29;wbpx:94;hbpx:22;efwpx:88;"
style="position:absolute; left:426px; top:29px; width:94px; height:22px; overflow:hidden;">
<table width="100%" cellspacing="0px" cellpadding="0px">
<colgroup>
<col width="*" />
<col width="18px" />
</colgroup>
<tr>
<td>
<input type="text" value="" name="PARTNER_ID" id="PARTNER_ID" style="width:70px;height:15px;" onchange="TextValidate(this,null,128,null);" />
<input type="hidden" name="PARTNER_IDsemaphore" id="PARTNER_IDsemaphore" value="write" />
<input type="hidden" name="PARTNER_IDformatter" id="PARTNER_IDformatter" value="none" />
</td>
<td>
<div class="anchorNoLink" style="width:18px;position:relative;top:1px;">
<a id="PARTNER_IDerrora" href="javascript:alert('');" style="display:none;">
<img id="PARTNER_IDerrorimg" src="Images/fielderror.gif" alt="" title="" />
</a>
</div>
</td>
</tr>
</table>
</div>
<div id="component_52" G360ComponentSpec="type:FieldComponent;dt:4;format:input;fh:none;" G360LayoutSpec="l:3;lip:t;lif:t;t:30;tip:t;tif:t;r:117;riw:t;rip:t;rif:t;ra:+-;b:22;bih:t;bip:t;bif:t;ba:+-;o:hidden;lbpx:3;tbpx:30;wbpx:117;hbpx:22;efwpx:0;" style="position:absolute; left:3px; top:30px; width:117px; height:22px; overflow:hidden;">
<table width="100%" cellspacing="0px" cellpadding="0px">
<colgroup>
<col width="*" />
<col width="18px" />
</colgroup>
<tr>
<td>
<select name="ENTITY_TYPE" id="ENTITY_TYPE" style="width:99px;" tabindex="1" onchange="setDirtyFlag(true,this);policyTypeSelected();">
<option selected value="NA">--Please Select --</option>
<option value="C">Retail Life Insured</option>
<option value="M">Group Life Insured</option>
<option value="A">Adviser</option>
<option value="F">Fund</option>
<option value="P">Partner</option>
<option value="S">Special Member</option>
<option value="U">Function</option>
</select>
<input type="hidden" name="ENTITY_TYPEoriginal" id="ENTITY_TYPEoriginal" value="TkE*" />
<input type="hidden" name="ENTITY_TYPEsemaphore" id="ENTITY_TYPEsemaphore" value="write" />
<input type="hidden" name="ENTITY_TYPEformatter" id="ENTITY_TYPEformatter" value="none" />
</td>
<td>
<div class="anchorNoLink" style="width:18px;position:relative;top:1px;">
<a id="ENTITY_TYPEerrora" href="javascript:alert('');" style="display:none;">
<img id="ENTITY_TYPEerrorimg" src="Images/fielderror.gif" alt="" title="" />
</a>
</div>
</td>
</tr>
</table>
</div>
<div id="component_24" G360ComponentSpec="type:FieldComponent;dt:4;format:input;fh:none;" G360LayoutSpec="l:124;lip:t;lif:t;t:30;tip:t;tif:t;r:200;riw:t;rip:t;rif:t;ra:+-;b:22;bih:t;bip:t;bif:t;ba:+-;o:hidden;lbpx:124;tbpx:30;wbpx:200;hbpx:22;efwpx:0;"
style="position:absolute; left:124px; top:30px; width:200px; height:22px; overflow:hidden;">
<table width="100%" cellspacing="0px" cellpadding="0px">
<colgroup>
<col width="*" />
<col width="18px" />
</colgroup>
<tr>
<td>
<input type="text" value="" name="POLICY_NUM" id="POLICY_NUM" style="width:176px;height:15px;" tabindex="2" maxlength="30" onchange="TextValidate(this,null,30,null);" />
<input type="hidden" name="POLICY_NUMsemaphore" id="POLICY_NUMsemaphore" value="write" />
<input type="hidden" name="POLICY_NUMformatter" id="POLICY_NUMformatter" value="none" />
</td>
<td>
<div class="anchorNoLink" style="width:18px;position:relative;top:1px;">
<a id="POLICY_NUMerrora" href="javascript:alert('');" style="display:none;">
<img id="POLICY_NUMerrorimg" src="Images/fielderror.gif" alt="" title="" />
</a>
</div>
</td>
</tr>
</table>
</div>
<div id="component_22" G360ComponentSpec="type:FieldComponent;dt:4;format:input;fh:none;" G360LayoutSpec="l:329;lip:t;lif:t;t:30;tip:t;tif:t;r:90;riw:t;rip:t;rif:t;ra:+-;b:22;bih:t;bip:t;bif:t;ba:+-;o:hidden;lbpx:329;tbpx:30;wbpx:90;hbpx:22;efwpx:0;"
style="position:absolute; left:329px; top:30px; width:90px; height:22px; overflow:hidden;">
<table width="100%" cellspacing="0px" cellpadding="0px">
<colgroup>
<col width="*" />
<col width="18px" />
</colgroup>
<tr>
<td>
<input type="text" value="" name="ADVISER_ID" id="ADVISER_ID" style="width:66px;height:15px;" tabindex="3" maxlength="9" onchange="TextValidate(this,null,9,null);" />
<input type="hidden" name="ADVISER_IDsemaphore" id="ADVISER_IDsemaphore" value="write" />
<input type="hidden" name="ADVISER_IDformatter" id="ADVISER_IDformatter" value="none" />
</td>
<td>
<div class="anchorNoLink" style="width:18px;position:relative;top:1px;">
<a id="ADVISER_IDerrora" href="javascript:alert('');" style="display:none;">
<img id="ADVISER_IDerrorimg" src="Images/fielderror.gif" alt="" title="" />
</a>
</div>
</td>
</tr>
</table>
</div>
<div id="component_54" G360ComponentSpec="type:FieldComponent;dt:4;format:input;fh:none;" G360LayoutSpec="l:428;lip:t;lif:t;t:30;tip:t;tif:t;r:180;riw:t;rip:t;rif:t;ra:+-;b:22;bih:t;bip:t;bif:t;ba:+-;o:hidden;lbpx:428;tbpx:30;wbpx:180;hbpx:22;efwpx:0;"
style="position:absolute; left:428px; top:30px; width:180px; height:22px; overflow:hidden;">
<table width="100%" cellspacing="0px" cellpadding="0px">
<colgroup>
<col width="*" />
<col width="18px" />
</colgroup>
<tr>
<td>
<input type="text" value="" name="FUND_ID" id="FUND_ID" style="width:156px;height:15px;" tabindex="4" maxlength="8" onchange="TextValidate(this,null,8,null);" />
<input type="hidden" name="FUND_IDsemaphore" id="FUND_IDsemaphore" value="write" />
<input type="hidden" name="FUND_IDformatter" id="FUND_IDformatter" value="none" />
</td>
<td>
<div class="anchorNoLink" style="width:18px;position:relative;top:1px;">
<a id="FUND_IDerrora" href="javascript:alert('');" style="display:none;">
<img id="FUND_IDerrorimg" src="Images/fielderror.gif" alt="" title="" />
</a>
</div>
</td>
</tr>
</table>
</div>
<div id="component_56" G360ComponentSpec="type:FieldComponent;dt:4;format:input;fh:none;" G360LayoutSpec="l:617;lip:t;lif:t;t:30;tip:t;tif:t;r:114;riw:t;rip:t;rif:t;ra:+-;b:22;bih:t;bip:t;bif:t;ba:+-;o:hidden;lbpx:617;tbpx:30;wbpx:114;hbpx:22;efwpx:0;"
style="position:absolute; left:617px; top:30px; width:114px; height:22px; overflow:hidden;">
<table width="100%" cellspacing="0px" cellpadding="0px">
<colgroup>
<col width="*" />
<col width="18px" />
</colgroup>
<tr>
<td>
<input type="text" value="" name="FUND_MEMBER_ID" id="FUND_MEMBER_ID" style="width:90px;height:15px;" tabindex="5" maxlength="60" onchange="TextValidate(this,null,60,null);" />
<input type="hidden" name="FUND_MEMBER_IDsemaphore" id="FUND_MEMBER_IDsemaphore" value="write" />
<input type="hidden" name="FUND_MEMBER_IDformatter" id="FUND_MEMBER_IDformatter" value="none" />
</td>
<td>
<div class="anchorNoLink" style="width:18px;position:relative;top:1px;">
<a id="FUND_MEMBER_IDerrora" href="javascript:alert('');" style="display:none;">
<img id="FUND_MEMBER_IDerrorimg" src="Images/fielderror.gif" alt="" title="" />
</a>
</div>
</td>
</tr>
</table>
</div>
</div>
你能編輯你的問題並分享你的HTML嗎? – JDelorean
添加了HTML @JDelorean – amitks