Discussion:
[wtr-general] WATIR is not waiting for select_list to exist
Raja gopalan
2017-08-09 14:50:11 UTC
Permalink
If I write

b.select_list(id: 'something').select("")


default timeout is not applied here for a select_list, it immediately
throws error if select_list doesn't exist

but If I write the following code


puts b.select_list(id: 'something').text #this would print the selected
option value according to new change


This line is waiting for select_list to exist.

This must be a bug, isn't it?
--
--
Before posting, please read http://watir.com/support. In short: search before you ask, be nice.

watir-***@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+***@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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Titus Fortner
2017-08-09 15:14:30 UTC
Permalink
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
http://groups.google.com/group/watir-general
watir-general+***@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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Raja gopalan
2017-08-10 07:14:50 UTC
Permalink
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).
Post by Titus Fortner
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
http://groups.google.com/group/watir-general
watir-general+***@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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Super Kevy
2017-08-10 16:04:48 UTC
Permalink
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
Post by Raja gopalan
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).
Post by Titus Fortner
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
http://groups.google.com/group/watir-general
watir-general+***@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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Raja gopalan
2017-08-10 16:23:14 UTC
Permalink
when_present is not necessary now because​ it's implicit since WATIR 6.0
ONWARDS.
Post by Super Kevy
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
Post by Raja gopalan
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).
Post by Titus Fortner
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.
http://groups.google.com/group/watir-general
---
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
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-***@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+***@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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Super Kevy
2017-08-10 17:15:20 UTC
Permalink
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
Post by Raja gopalan
when_present is not necessary now because​ it's implicit since WATIR 6.0
ONWARDS.
Post by Super Kevy
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
Post by Raja gopalan
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).
Post by Titus Fortner
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.
http://groups.google.com/group/watir-general
---
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
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-***@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+***@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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Raja gopalan
2017-08-11 10:09:28 UTC
Permalink
You haven't read my question clearly, It throws the error that given
select_list is not found without waiting, From WATIR 6.0 onwards, waiting
for element to present is implicit.
Post by Super Kevy
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
Post by Raja gopalan
when_present is not necessary now because​ it's implicit since WATIR 6.0
ONWARDS.
Post by Super Kevy
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
Post by Raja gopalan
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).
Post by Titus Fortner
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.
http://groups.google.com/group/watir-general
---
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
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-***@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+***@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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Titus Fortner
2017-08-10 17:26:31 UTC
Permalink
You were right, the update in 6.4 changed how options get waited for on
Select Lists.
Fix is here: https://github.com/watir/watir/pull/619
Will be in the 6.7 release whenever that happens

Thanks for providing a reproducible case.
Post by Raja gopalan
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).
Post by Titus Fortner
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
http://groups.google.com/group/watir-general
watir-general+***@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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Raja gopalan
2017-08-11 10:10:11 UTC
Permalink
Thank you Titus!

Will be in the 6.7 release whenever that happens


Will it be soon?
Post by Titus Fortner
You were right, the update in 6.4 changed how options get waited for on
Select Lists.
Fix is here: https://github.com/watir/watir/pull/619
Will be in the 6.7 release whenever that happens
Thanks for providing a reproducible case.
Post by Raja gopalan
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).
Post by Titus Fortner
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
http://groups.google.com/group/watir-general
watir-general+***@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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...