0
Ruby新手,需要一些幫助。將變量傳遞給select_list,我想查找與變量匹配的第一個選項。watir select_list正則表達式變量NoValueFoundException
列表選項有:
- 波特蘭
- 波特蘭,ME
- 波特蘭,俄勒岡
...我分配城市可變
var="Portland"
使用: f.select_list(:id => /location/).select(/var/)
給NoValueFoundException
但是當我使用...
`f.select_list(:id => /location/).select(/Portland/) #no exception, gives 1st entry`
如何訪問使用正則表達式和變量的第一個選項?