我是網絡應用程序自動化測試的新手。我正在使用watir-webdriver通過應用程序自動執行我們的功能測試。 我將我的javascript下拉菜單與Watir一起測試,就像我知道的一樣。我無法過去,每一次嘗試都會導致錯誤。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/[email protected]/components/command_processor
第二個測試碼
browser.select_list(:name => 'tx_bodpricecalculation_pi1[product]').select('Fun')
第二個測試,OutputTest套房
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/[email protected]/components/command_processor.js:8179:in `fxdriver.preconditions.visible'
# [remote server] file:///var/folders/8m/3byyttvd4cxbqx22s60hvb4c0000gn/T/webdriver- profile20140212-5829-ry619a/extensions/[email protected]/components/command_processor.js:10814:in `DelayedCommand.prototype.checkPreconditions_'
我得到了下面的測試根本就沒有去。 =>點擊PRODUKTNEU =>選擇FUNNEU
最後是發生,計算產品FUNNEU。只是部分和PRODUKTNEU和FUNNEU造成問題。
關於你的幫助,我將非常感激
你能分享你嘗試什麼,你得到了錯誤? (這樣做可以節省給出/獲得答案的努力,而您已經知道這些答案是行不通的。) –
我的Watir代碼和我的測試輸出在1答案 – mattrock