selenium 如何捕获类型为DIV 的弹出对话框里面的元素?
以下是页面结构,点击了<a class="my-A" href="#">edit</a> 后,页面就会弹出ID 为“edit-A”的DIV对话框,,怎么用selenium定位里面的yes 和 no 按钮呢?<div class='A'>
<a class="my-A" href="#">edit</a>
<div id="edit-A" class="popup container" style="display: block;">
<div class="popup-content container">
<h2>Warning</h2>
<p>If you return to your basket now, the information you have supplied in checkout will not be saved.</p>
<p>Do you want to continue to your shopping basket?</p>
<div class="container">
<div class="button btn-yes">
<button name="yes" value="yes" type="button">yes</button>
</div>
<div class="button btn-no">
<button name="no" value="no" type="button">no</button>
</div>
</div>
</div>
</div>
</div> 额哦,,原来这种是通过样式实现的,,直接用XPath就可以了,,嘿嘿 我的也一样,没有id怎么找,xpath找不到 //button
//button
页:
[1]