【发布时间】:2014-02-28 21:23:57
【问题描述】:
我正在使用 Watir-Webdriver。该脚本在 Firefox 上适用于我,但是在 Google 和 IE 上,一旦我将数据输入到模式中,它就会立即中断。我还注意到 IEDriver 与 ChromeDriver 和 Firefox 相比,在文本字段中输入文本非常慢,这也会破坏脚本。
这是我在运行 ChromeDriver 或 IEDriver 时遇到的错误:
===============================================================================
Failure: <nil> is not true.
test_orderjellybean(TestShoppingCart)
C:/Users/cameron.sampson/Desktop/shopping cart auto/shoppingcart-jellybean.rb:69
:in `test_orderjellybean'
66:
67: # Select Monthly Plans for data, minutes and text
68: assert @b.div(:class, 'modal-body')
=> 69: assert @b.text_field(:id, 'ZipCode').set '92130'
70: assert @b.button(:value, 'Confirm').click
71: sleep 5
72:
===============================================================================
我已经更新了 ChromeDriver、Watir-Webdriver 和 Selenium-Webdriver。是否应该安装其他一些 gem 以使跨浏览器自动化功能更强大?
这是我运行它的 HTML 源代码:
<div class="modal fade" id="modal-checkplans">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-body">
<h3>Confirm Coverage</h3>
<div class="alert alert-danger fade hidden">
<p><strong>We are sorry :(</strong>
<br>
This product should work almost anywhere in the U.S. where it is available, your address is one of the few locations where coverage is not available. If you feel that this is an error, please call customer service at 000-000-0000. </p>
</div>
<form class="form-ajax form-inline" action="/Cart/cart/checkservice" data-callback="OnCheckNetworkCoverageComplete">
<label for="PostalCode">Enter the zip code where the phone will be used most often:</label>
<div class="input-group col-4 col-8">
<input autofocus="autofocus" class="form-control" data-val="true" data-val-length="Postal code must be between 5 and 10 digits." data-val-length-max="10" data-val-length-min="5" data-val-required="*required" id="ZipCode" name="ZipCode" type="text" value="" />
<span class="input-group-btn">
<input type="submit" class="btf btf-info" data-loading-text="Checking..." value="Confirm" />
</span>
</div>
<span class="field-validation-valid" data-for="ZipCode" data-replace="true"></span>
</form>
</div>
</div>
</div>
</div>
【问题讨论】:
标签: watir watir-webdriver selenium-chromedriver