So the option list is probably not populated yet.  Maybe its a generated 
list.  
Then wait for the option to be present

browser.select_list(:id => 'theId').option(:value => 
'Ruby').wait_until_present
browser.select_list(:id => 'theId').option.wait_until_present

On Thursday, August 10, 2017 at 11:23:19 AM UTC-5, Raja gopalan wrote:
>
> when_present is not necessary now because‚Äč it's implicit since WATIR 6.0 
> ONWARDS.
>
> On Aug 10, 2017 9:34 PM, "Super Kevy" <kpetr...@gmail.com <javascript:>> 
> wrote:
>
>> The object may not be visible
>> The first hack is to add a sleep before the select. Not elegant but the 
>> kludge usually works
>> sleep 30
>>
>> A better method is to wait for it to be present
>>
>> b.select_list(:id => 'entry_10000').when_present.select('Ruby')
>> or 
>> b.select_list(:id => 'entry_10000')..wait_until_present
>>
>>
>>
>> On Thursday, August 10, 2017 at 2:14:50 AM UTC-5, Raja gopalan wrote:
>>>
>>> Why it's not a bug? 
>>>
>>> Take any html file, select_list part is acting in a same way, that is, 
>>> it's not waiting for select_list to exist, for an example, consider the 
>>> code below
>>>
>>> require 'watir'
>>>
>>> b.goto 'bit.ly/watir-webdriver-demo'
>>>
>>> b.element(id: 'entry_100000').send_keys 'Hi'
>>>
>>> I made a mistake in Id but it waits for 30 seconds but If I write the 
>>> below code
>>>
>>> require 'watir'
>>>
>>> b.goto 'bit.ly/watir-webdriver-demo'
>>>
>>> s = b.select_list(id: 'entry_100000').select 'Ruby'
>>>
>>>
>>> It's not waiting for select_list to exist.(Made a mistake in the id).
>>>
>>>
>>>
>>> On Wednesday, August 9, 2017 at 8:44:31 PM UTC+5:30, Titus Fortner wrote:
>>>>
>>>> This is unlikely a bug in Watir.
>>>>
>>>> For us to investigate further please provide
>>>> Your code
>>>> Applicable portion of html
>>>> A log of your test run in debug mode
>>>>
>>> -- 
>> -- 
>> Before posting, please read http://watir.com/support. In short: search 
>> before you ask, be nice.
>>  
>> watir-...@googlegroups.com <javascript:>
>> http://groups.google.com/group/watir-general
>> watir-genera...@googlegroups.com <javascript:>
>>
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "Watir General" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to watir-genera...@googlegroups.com <javascript:>.
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com

--- 
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to watir-general+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to