如何使用watir-classic处理IE中的弹出窗口

时间:2017-04-28 12:46:44

标签: ruby watir watir-classic

我试图点击关闭但没有点击。

下面是我的代码:

b.button(:class , "close").click

HTML code:

 <div class="modal-content alert-">
<div class="modal-body">
<button class="close" data-dismiss="modal" type="button">
<span aria-hidden="true">×</span>
<span class="sr-only">Close</span>
</button>
<div>
<h4 id="daModal1493381568370"/>
</div>
<br/>
<p>Invalid driving experience, please call us at 666 55555 for assistance</p>
</div>
</div>

注意:首先我尝试检查警报是否存在,然后点击关闭。

b.alert.exists?# i'm getting false
b.button(:class , "close").click

还尝试过:

b.span(:class , "sr-only").click

0 个答案:

没有答案