【发布时间】:2014-03-08 04:51:32
【问题描述】:
我是网络应用自动化测试的新手。我正在使用 watir-webdriver 使用应用程序自动化我们的功能测试。 我会像我一样知道我的 javascript 下拉菜单来测试 Watir。我只是无法过去,每次尝试都会导致错误。
关于一个提示,我将非常感激
<section class="price-calculation" data-view="Forms.Pricecalculation,Forms.HelpInfo">
<form action="/index.php" method="post" class="">
<input type="hidden" name="tx_bodpricecalculation_pi1[controller]" value="priceCalc">
<input type="hidden" name="tx_bodpricecalculation_pi1[action]" value="calculate">
<input type="hidden" name="type" value="54321">
<input type="hidden" name="tx_bodpricecalculation_pi1[isEditor]" value="0">
<input type="hidden" name="tx_bodpricecalculation_pi1[binding]" id="binding" value="">
<section class="input-group-container select-casade clearfix">
<div class="input-group product first">
<div class="input-fields">
<select name="tx_bodpricecalculation_pi1[product]" data-required="" id="selFNF" class="chzn-done" style="display: none;">
<option value="" selected="selected" disabled="">ProduktNEU</option>
<option value="FunNEU">FunNEU</option>
<option value="ClassicNEU">ClassicNEU</option>
<option value="ComfortNEU">ComfortNEU</option>
</select><div id="selFNF_chzn" class="chzn-container chzn-container-single chzn-container-single-nosearch" style="width: 76px;" title=""><a href="javascript:void(0)" class="chzn-single"><span>Comfort</span><div><b></b></div></a><div class="chzn-drop"><div class="chzn-search"><input type="text" autocomplete="off" readonly=""></div><ul class="chzn-results" tabindex="-1"><li id="selFNF_chzn_o_0" class="disabled-result" style="">Produkt</li><li id="selFNF_chzn_o_1" class="active-result" style="">Fun</li><li id="selFNF_chzn_o_2" class="active-result" style="">Classic</li><li id="selFNF_chzn_o_3" class="active-result result-selected" style="">Comfort</li></ul></div></div>
</div>
<a class="btn-help" href="#" tabindex="-1" data-helpid="731"></a>
<div class="error-message">
<span class="desktop">Bitte</span> Ergänzen Sie die Angaben
</div>
</div>
第一个测试代码
browser.select_list(:class => 'chzn-done').select('Fun')
第一次测试输出
Test Suite
New Test Case (FAILED - 1)
Failures:
1) Test Suite New Test Case
Failure/Error: browser.select_list(:class => 'chzn-done').select('FunNEU')
Selenium::WebDriver::Error::ElementNotVisibleError:
Element is not currently visible and so may not be interacted with
# [remote server] file:///var/folders/8m/3byyttvd4cxbqx22s60hvb4c0000gn/T/webdriver- profile20140212-5829-7ai1pp/extensions/fxdriver@googlecode.com/components/command_processor
第二个测试代码
browser.select_list(:name => 'tx_bodpricecalculation_pi1[product]').select('Fun')
第二个测试输出测试套件
Test Suite
New Test Case (FAILED - 1)
Failures:
1) Test Suite New Test Case
Failure/Error: browser.select_list(:name => 'tx_bodpricecalculation_pi1[product]').select('FunNEU')
Selenium::WebDriver::Error::ElementNotVisibleError:
Element is not currently visible and so may not be interacted with
# [remote server] file:///var/folders/8m/3byyttvd4cxbqx22s60hvb4c0000gn/T/webdriver- profile20140212-5829- ry619a/extensions/fxdriver@googlecode.com/components/command_processor.js:8179:in `fxdriver.preconditions.visible'
# [remote server] file:///var/folders/8m/3byyttvd4cxbqx22s60hvb4c0000gn/T/webdriver- profile20140212-5829-ry619a/extensions/fxdriver@googlecode.com/components/command_processor.js:10814:in `DelayedCommand.prototype.checkPreconditions_'
我得到下面的测试根本不去。 => 点击 PRODUKTNEU => 选择 FUNNEU
最后将进行产品 FUNNEU 的计算。只是零件,PRODUKTNEU 和 FUNNEU 会出问题。
关于您的帮助,我将不胜感激
【问题讨论】:
-
你能分享你的尝试和你得到的错误吗? (这样做可以省去给出/获得您已经知道不起作用的答案的工作量。)
-
我的 Watir 代码和我的测试输出在 1 个答案中
标签: javascript jquery selenium watir watir-webdriver