【发布时间】:2016-07-31 21:32:08
【问题描述】:
我需要选择这个输入
`(name="BtnOK" value="TAMAM" class="BoxButtonOK")`
在此模式弹出窗口之后使用xpath。我不能使用.FindByClass,因为主页中有相同的类,但我需要在(id="__LIGHTBOX__") 模态中打开它,当我使用xpath 时,有时它会给我错误“无法定位元素”,有时它会奇怪有效。
这是我的xpath 代码(是的,我已经尝试过wait.until 并且没有任何进展):
//div[contains(@id, 'LIGHTBOX')]//input[@name='BtnNext' and contains(@class, 'NavigationButtonNextLightBox')]
这里是模态的:
<div id="__LIGHTBOX__" style="overflow: visible; padding: 0px; width: auto; min-height: 143px; max-height: none; height: auto;" class="ui-dialog-content ui-widget-content" >
<div class="__BOX__">
<input name="BtnClose" class="BoxButtonClose" type="button">
<div>
<img src="/Content/themes/base/images/popup-bg-top.png">
</div>
<div class="popupCapsule clearFix">
<div class="banner clearFix">
<h1 class="pageTitle">Fatura Ödeme</h1>
</div>
<div class="noteCapsulePopupContainer">
<div>
<img src="/Content/themes/base/images/note-capsule-top-success.png">
</div>
<div class="noteCapsulePopup">
<table>
<tbody>
<tr>
<td class="waitingTd"></td>
<td>
<p id="TransactionFlowNote">
<span>
<span class="important">10177202-1 (Beşyüzevler Şube)</span> adlı hesabımdan <span class="important">27,50 TL</span> tutarındaki <span class="important">5387373484</span> abone numarasına ait <span class="important">TURKCELL</span> faturası kurumuna iletildi, borcunuz kısa süre içerisinde tahsil edilecektir.
</span>
</p>
</td>
</tr>
</tbody>
</table>
</div>
<div>
<img src="/Content/themes/base/images/note-capsule-sub.png">
</div>
</div>
<table class="popupButtonArea">
<tbody>
<tr>
<td class="left"></td>
<td class="right">
<input name="BtnSlip" value="DEKONT" class="popupOpenLink" style="margin-right: 5px;" href="/Slip/Index/201504220001012380000019284/" type="button"><input name="BtnPeopleAndPlaces" value="İŞLEMİ KAYDET" class="popupOpenLink ButtonWide2" style="margin-right: 5px;" href="/PeopleAndPlaces/SaveTransaction/201504220001012380000019284/1238/False" type="button">
<input name="BtnOK" value="TAMAM" class="BoxButtonOK" type="button">
</td>
</tr>
</tbody>
</table>
</div>
<div>
<img src="/Content/themes/base/images/popup-bg-sub.png">
</div>
</div>
【问题讨论】: