0
我無法讓Watir從下拉列表中選擇正確的選項。我試圖從中選擇:Watir無法選擇下拉選項(Ruby)
<select id="j_id0:theForm:ruleTypeSelector" onkeypress="return suppressEnter(event);" size="1" name="j_id0:theForm:ruleTypeSelector">
<option value="ExecutionOrder">Pricing Administration</option>
<option value="AccountSpecific">Account Specific Pricing</option>
<option value="AssociatedProduct">Associated Product Pricing</option>
<option value="MaintenanceProduct">Maintenance Product Pricing</option>
<option value="Tiered">Tiered Pricing</option>
<option value="Volume">Volume Pricing</option>
</select>
我需要選擇第二個選項AccountSpecific,但它不工作。
我試圖
option = browser.select_list(:id => /.*ruleTypeSelector.*/).select("AccountSpecific")
和
option = browser.select_list(:id => /.*ruleTypeSelector.*/).option(:value => "AccountSpecific")
browser.select_list(:id => /.*ruleTypeSelector.*/)
option.wait_until_present
option.select
browser.button(:value => "Go").click
但是兩次,它,而不是選擇第一個選項,ExecutionOrder。
爲什麼這不起作用?我還能嘗試什麼?
這樣做的竅門!謝謝你的幫助! – Leelluu