1
<div class="wizardPanel box cf" id="wizardPanel">
    <p class="validation-msg error visually-hidden" id="error0"><span data-icon="warn"></span>Your departure and arrival cites must be different. Please correct the highlighted fields below.</p>
    <p class="validation-msg error visually-hidden" id="error1"><span data-icon="warn"></span>The return date must be later than the departure date. Please select a different date.</p>
    <p class="validation-msg error visually-hidden" id="error2"><span data-icon="warn"></span>Sorry, we're able to book only 1 to 6 passengers total per itinerary.</p>
    <p class="validation-msg error visually-hidden" id="error3"><span data-icon="warn"></span>Please select the ages of the children traveling.</p>
    <p class="validation-msg error visually-hidden" id="error4"><span data-icon="warn"></span>We are only able to book one infant in lap per traveler aged 12+.</p>
    <p class="validation-msg error visually-hidden" id="error5"><span data-icon="warn"></span>Children must not be allowed to travel without either a Senior or Adult.</p>
    <p class="validation-msg error visually-hidden" id="error6"><span data-icon="warn"></span>Please check the date highlighted below. Date format should be mm/dd/yy.</p>
    <p class="validation-msg error visually-hidden" id="error7"><span data-icon="warn"></span>Departure airport field is empty. Please enter correct airport name.</p>
    <p class="validation-msg error visually-hidden" id="error8"><span data-icon="warn"></span>Arrival airport field is empty. Please enter correct airport name.</p>
</div>

在上面的 HTML 标记中,我试图找出文本是否对用户可见。为此,我使用了以下代码,该代码与 Watir-webDriver 配合良好,但不适用于 Watir-Classic(总是返回false):

@browser.div(:id => 'wizardPanel').p(:id => 'error2')..present?

有人可以帮我让它在 FireFox、IE、Chrome 浏览器上运行吗?

4

1 回答 1

0

尝试

@browser.div(:id => 'wizardPanel').p(:id => 'error2').visible?
于 2012-10-20T00:40:49.143 回答