2013-04-01 2 views
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을 선택해야하지만 작동하지 않습니다.

내가 대신 ExecutionOrder, 첫 번째 옵션을 선택하고,

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 

하지만 두 번

을 시도했다.

왜 작동하지 않습니까? 그 밖의 무엇을 시도 할 수 있습니까?

답변

1
browser.select_list(:id => /.*ruleTypeSelector.*/).option(:text =>"Account Specific Pricing").when_present.select 
+0

그건 속임수 였어! 당신의 도움을 주셔서 감사합니다! – Leelluu

관련 문제