This snippet show the issue on FF3/Mac. select_list on craigslist
seems to be invisible. FWIW, Selenium IDE can address the select_list
with no problem
#CAN'T ADDRESS BY INDEX
@browser.select_list(:index,1).set("software jobs")
#CAN'T ADDRESS BY ID
@browser.select_list(:id,"cAbb").set("software jobs")
#CAN'T SET THE select_list VIA 'value=foo'
@browser.select_list(:id,"cAbb").set("sof")
FireWatir generates no error for any of these calls.
Try to print out html for that select_list to make sure that you are
really dealing with the correct select_list and there aren't any
hidden ones or whatsoever. Or try just plain old .flash method to see
if correct list is flashing :)
Jarmo
On Apr 5, 7:07 am, Chris <christopher.mcma...@gmail.com> wrote:
> This snippet show the issue on FF3/Mac. select_list on craigslist
> seems to be invisible. FWIW, Selenium IDE can address the select_list
> with no problem
> #CAN'T ADDRESS BY INDEX
> @browser.select_list(:index,1).set("software jobs")
> #CAN'T ADDRESS BY ID
> @browser.select_list(:id,"cAbb").set("software jobs")
> #CAN'T SET THE select_list VIA 'value=foo'
> @browser.select_list(:id,"cAbb").set("sof")
> FireWatir generates no error for any of these calls.
The issue is not that the select_list element is invisible - you can
address it correctly as show by calling:
@browser.select_lists
or
@browser.select_list(:id, 'cAbb')
Calling the "methods" method on the element reveals that the "set"
method you are calling is not present. I was surprised to see that
this method exists - I've always used the "select" method, which works
fine. The RDoc reveals that set should be an alias for select.
I would suggest using the select method for the time being:
@browser.select_list(:id,"cAbb").select("software jobs")
However, if you wish to use the set method, add the following code to
your firewatir/htmlelements.rb file in the SelectList class beneath
the select method's definition:
alias :set :select
> Try to print out html for that select_list to make sure that you are
> really dealing with the correct select_list and there aren't any
> hidden ones or whatsoever. Or try just plain old .flash method to see
> if correct list is flashing :)
> Jarmo
> On Apr 5, 7:07 am, Chris <christopher.mcma...@gmail.com> wrote:
>> This snippet show the issue on FF3/Mac. select_list on craigslist
>> seems to be invisible. FWIW, Selenium IDE can address the
>> select_list
>> with no problem
>> #CAN'T ADDRESS BY INDEX
>> @browser.select_list(:index,1).set("software jobs")
>> #CAN'T ADDRESS BY ID
>> @browser.select_list(:id,"cAbb").set("software jobs")
>> #CAN'T SET THE select_list VIA 'value=foo'
>> @browser.select_list(:id,"cAbb").set("sof")
>> FireWatir generates no error for any of these calls.
> Calling the "methods" method on the element reveals that the "set"
> method you are calling is not present. I was surprised to see that
> this method exists - I've always used the "select" method, which works
> fine. The RDoc reveals that set should be an alias for select.
> I would suggest using the select method for the time being:
> @browser.select_list(:id,"cAbb").select("software jobs")
> However, if you wish to use the set method, add the following code to
> your firewatir/htmlelements.rb file in the SelectList class beneath
> the select method's definition:
> alias :set :select
Alex, thanks very much. I should have thought of some of that
myself-- it has been some time since I've worked closely with Watir.
Seems like I should have gotten a NoMethodError trying what I did, but
I'm glad that there *is* a right method.
there is some functionality in firewatir ( at least the version that I had
been using) that doesnt generate exceptions when there is a javascript
exception. Id fixed this some where once ( probably in a local copy of
firewatir) , but I guess the code got lost
> > Calling the "methods" method on the element reveals that the "set"
> > method you are calling is not present. I was surprised to see that
> > this method exists - I've always used the "select" method, which works
> > fine. The RDoc reveals that set should be an alias for select.
> > I would suggest using the select method for the time being:
> > @browser.select_list(:id,"cAbb").select("software jobs")
> > However, if you wish to use the set method, add the following code to
> > your firewatir/htmlelements.rb file in the SelectList class beneath
> > the select method's definition:
> > alias :set :select
> Alex, thanks very much. I should have thought of some of that
> myself-- it has been some time since I've worked closely with Watir.
> Seems like I should have gotten a NoMethodError trying what I did, but
> I'm glad that there *is* a right method.
> The issue is not that the select_list element is invisible - you can
> address it correctly as show by calling:
> @browser.select_lists
> or
> @browser.select_list(:id, 'cAbb')
> Calling the "methods" method on the element reveals that the "set"
> method you are calling is not present. I was surprised to see that
> this method exists - I've always used the "select" method, which works
> fine. The RDoc reveals that set should be an alias for select.
> I would suggest using the select method for the time being:
> @browser.select_list(:id,"cAbb").select("software jobs")
> However, if you wish to use the set method, add the following code to
> your firewatir/htmlelements.rb file in the SelectList class beneath
> the select method's definition:
> alias :set :select
> Best wishes,
> Alex
> On 12 Apr 2009, at 00:07, Jarmo Pertman wrote:
> > Try to print out html for that select_list to make sure that you are
> > really dealing with the correct select_list and there aren't any
> > hidden ones or whatsoever. Or try just plain old .flash method to see
> > if correct list is flashing :)
> > Jarmo
> > On Apr 5, 7:07 am, Chris <christopher.mcma...@gmail.com> wrote:
> >> This snippet show the issue on FF3/Mac. select_list on craigslist
> >> seems to be invisible. FWIW, Selenium IDE can address the
> >> select_list
> >> with no problem
> >> #CAN'T ADDRESS BY INDEX
> >> @browser.select_list(:index,1).set("software jobs")
> >> #CAN'T ADDRESS BY ID
> >> @browser.select_list(:id,"cAbb").set("software jobs")
> >> #CAN'T SET THE select_list VIA 'value=foo'
> >> @browser.select_list(:id,"cAbb").set("sof")
> >> FireWatir generates no error for any of these calls.
Angrez Singh wrote:
> Can somebody put this in JIRA so that we can make Firewatir/Watir more > compatible?
> - Angrez
> On Sun, Apr 12, 2009 at 3:32 PM, Alex Collins > <a.j.collins...@gmail.com <mailto:a.j.collins...@gmail.com>> wrote:
> I've just had a quick look, also on FF3/Mac.
> The issue is not that the select_list element is invisible - you can
> address it correctly as show by calling:
> @browser.select_lists
> or
> @browser.select_list(:id, 'cAbb')
> Calling the "methods" method on the element reveals that the "set"
> method you are calling is not present. I was surprised to see that
> this method exists - I've always used the "select" method, which works
> fine. The RDoc reveals that set should be an alias for select.
> I would suggest using the select method for the time being:
> @browser.select_list(:id,"cAbb").select("software jobs")
> However, if you wish to use the set method, add the following code to
> your firewatir/htmlelements.rb file in the SelectList class beneath
> the select method's definition:
> alias :set :select
> Best wishes,
> Alex
> On 12 Apr 2009, at 00:07, Jarmo Pertman wrote:
> > Try to print out html for that select_list to make sure that you are
> > really dealing with the correct select_list and there aren't any
> > hidden ones or whatsoever. Or try just plain old .flash method
> to see
> > if correct list is flashing :)
> > Jarmo
> > On Apr 5, 7:07 am, Chris <christopher.mcma...@gmail.com
> <mailto:christopher.mcma...@gmail.com>> wrote:
> >> This snippet show the issue on FF3/Mac. select_list on craigslist
> >> seems to be invisible. FWIW, Selenium IDE can address the
> >> select_list
> >> with no problem
> >> #CAN'T ADDRESS BY INDEX
> >> @browser.select_list(:index,1).set("software jobs")
> >> #CAN'T ADDRESS BY ID
> >> @browser.select_list(:id,"cAbb").set("software jobs")
> >> #CAN'T SET THE select_list VIA 'value=foo'
> >> @browser.select_list(:id,"cAbb").set("sof")
> >> FireWatir generates no error for any of these calls.
> 1. Firewatir does not issue an error when users use undefined methods.
Agree with this. I had a quick look but my trivial catch-all patch breaks various tests. I'll have a look tomorrow at fitting this into element.rb's method_missing call.
> 2. SelectList#set needs to be defined as an alias for > SelectList#select > (as it is in IE-Watir).
I checked this morning - this is already fixed in the firewatir on GitHub in Bret's Watir repository.