設計:
最初のドロップダウン:
<select id="MainContent_drpVehicleType" style="width:175px;" name="ctl00$MainContent$drpVehicleType">
<option value="">- SELECT -</option>
<option value="1" title="AUTO">AUTO</option>
<option value="2" title="HD">HD</option>
<option value="3" title="MARINE">MARINE</option>
</select>
2番目のドロップダウン:
<select id="MainContent_drpMake" style="width:175px;" name="ctl00$MainContent$drpVehicleType">
<option value="1" title="ACURA">ACURA</option>
<option value="2" title="ALFA ROMEO">ALFA ROMEO</option>
<option value="74" title="ALLIS CHALMERS LIFT TRUCK">ALLIS CHALMERS LIFT TRUCK</option>
<option value="75" title="ALLIS CHALMERS TRACTOR">ALLIS CHALMERS TRACTOR</option>
<option value="4" title="AMERICAN MOTORS">AMERICAN MOTORS</option
</select>
実行に使用されるコード:
b.select_list(:id, "MainContent_drpVehicleType").select("AUTO")
b.select_list(:id, "MainContent_drpMake").select("ACURA")
そしてまた試した
`b.select_list(:id, "MainContent_drpMake").wait_until_present.option(:text, 'ACURA')`
**私の問題は最初のドロップダウンから「AUTO」を選択でき、2番目のドロップダウンから「ACURA」を選択できないこと
実行中のエラー:
C:/Ruby193/menu.rb:23:in `<main>':
C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-webdriver-0.6.2/lib/watir-webdriver/el
ements/select.rb:218:in `no_value_found': "ACURA" not found in select list (Wati
r::Exception::NoValueFoundException)
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-webdriver-0.6.2/lib/watir
-webdriver/elements/select.rb:152:in `rescue in select_by_string'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-webdriver-0.6.2/lib/watir
-webdriver/elements/select.rb:149:in `select_by_string'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-webdriver-0.6.2/lib/watir
-webdriver/elements/select.rb:131:in `select_by'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-webdriver-0.6.2/lib/watir
-webdriver/elements/select.rb:64:in `select'
from C:/Ruby193/menu.rb:23:in `<main>'**