Undefined method `each' for :ole_object:Symbol (NoMethodError)

162 views
Skip to first unread message

sridhar

unread,
Nov 8, 2011, 3:58:26 PM11/8/11
to Watir General
Hi,

Today i installed Ruby 1.9.2 and i have the following problem. Was
working fine with Ruby 1.8.6. Please help!

I am getting the error "Undefined method `each' for :ole_object:Symbol
(NoMethodError)" when clicking a button using the code.

ie.frame(:id,"body").table(:id,"recordListButton_UserList_ctl00")[1]
[2].click_no_wait

I am using "ruby 1.9.2p180 (2011-02-18) [i386-mingw32]". This was
working fine with ruby 1.8.6 (2008-08-11 patchlevel 287) [i386-
mswin32]

Error:
----------
C:/Ruby192/lib/ruby/gems/1.9.1/gems/watir-2.0.4/lib/watir/locator.rb:
11:in `normalize_specifiers!': undefined method `each'
for :ole_object:Symbol (NoMethodError)
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/watir-2.0.4/lib/watir/
locator.rb:43:in `set_specifier'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/watir-2.0.4/lib/watir/
container.rb:109:in `tagged_element_locator'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/watir-2.0.4/lib/watir/
element.rb:36:in `locate'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/watir-2.0.4/lib/watir/
table.rb:249:in `locate'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/watir-2.0.4/lib/watir/
element.rb:75:in `assert_exists'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/watir-2.0.4/lib/watir/
table.rb:285:in `[]'
from //coldstorage/intranet/QA/Automation/Clickability for Blank DB-
New Look and Feel/Admin Tab/Click_User_page_CC.rb:75:in `<main>'
>Exit code: 0

The line 75 in Click_User_page_CC.rb is:
ie.frame(:id,"body").table(:id,"recordListButton_UserList_ctl00")[1]
[2].click_no_wait


I have the following gems intalled on my machine:


*** LOCAL GEMS ***

activesupport (2.3.9)
builder (3.0.0)
commonwatir (2.0.4, 2.0.3, 1.7.1, 1.6.7)
ffi (1.0.9 x86-mingw32)
firewatir (1.7.1, 1.6.7)
hoe (2.12.3)
minitest (1.6.0)
nokogiri (1.5.0 x86-mingw32)
rake (0.8.7)
rautomation (0.6.3)
rdoc (2.5.8)
s4t-utils (1.0.4)
user-choices (1.1.6.1)
watir (2.0.4)
win32-api (1.4.8 x86-mingw32)
win32-process (0.6.5)
windows-api (0.4.0)
windows-pr (1.2.1)
xml-simple (1.1.1)




Jarmo Pertman

unread,
Nov 9, 2011, 4:13:52 PM11/9/11
to Watir General
Does this code make any difference:

ie.frame(:id,"body").table(:id,"recordListButton_UserList_ctl00").row(:index
=> 1).cell(:index => 2).click_no_wait

Jarmo Pertman
-----
IT does really matter - http://itreallymatters.net

sridhar

unread,
Nov 9, 2011, 6:10:35 PM11/9/11
to Watir General
Jarmo, the code you suggested is working in Watir 1.8.6. It is not
working in Watir 1.9.2. Watir 1.9.2 says unable to locate using row
index 1.

I found that
ie.frame(:id,"body").table(:id,"recordListButton_UserList_ctl00").click_no_wait
is working with Watir 1.9.2. I don't understand why
ie.frame(:id,"body").table(:id,"recordListButton_UserList_ctl00")[1]
[2].click_no_wait does not work in Watir 1.9.2. I can replace
"table(:id,"recordListButton_UserList_ctl00")[1][2]" in my code with
"table(:id,"recordListButton_UserList_ctl00")". But i would like to
know if there is a solution for this problem. Because if i had to
replace like this i need to do it in lot many places.

As i described earlier the error message says "Undefined method `each'
for :ole_object:Symbol (NoMethodError)". I am not using each method
anywhere in my code. This looks like an issue with Watir 1.9.2?


On Nov 9, 2:13 pm, Jarmo Pertman <jarm...@gmail.com> wrote:
> Does this code make any difference:
>
> ie.frame(:id,"body").table(:id,"recordListButton_UserList_ctl00").row(:inde­x
> => 1).cell(:index => 2).click_no_wait
>
> Jarmo Pertman
> -----
> IT does really matter -http://itreallymatters.net
>
> On Nov 8, 10:58 pm, sridhar <sridhar...@gmail.com> wrote:
>
>
>
> > Hi,
>
> > Today i installed Ruby 1.9.2 and i have the following problem. Was
> > working fine with Ruby 1.8.6.  Please help!
>
> > I am getting the error "Undefinedmethod`each' for :ole_object:Symbol
> > (NoMethodError)" when clicking a button using the code.
>
> > ie.frame(:id,"body").table(:id,"recordListButton_UserList_ctl00")[1]
> > [2].click_no_wait
>
> > I am using "ruby 1.9.2p180 (2011-02-18) [i386-mingw32]". This was
> > working fine with ruby 1.8.6 (2008-08-11 patchlevel 287) [i386-
> > mswin32]
>
> > Error:
> > ----------
> > C:/Ruby192/lib/ruby/gems/1.9.1/gems/watir-2.0.4/lib/watir/locator.rb:
> > 11:in `normalize_specifiers!':undefinedmethod`each'
> > xml-simple (1.1.1)- Hide quoted text -
>
> - Show quoted text -

Chuck van der Linden

unread,
Nov 9, 2011, 7:51:31 PM11/9/11
to Watir General
Have you considered updating to a newer patch level of ruby 1.9.2?
The most recent release of that version is P290

not sure if it will help, but doubt it would hurt.

Chuck van der Linden

unread,
Nov 9, 2011, 8:05:30 PM11/9/11
to Watir General
On Nov 9, 3:10 pm, sridhar <sridhar...@gmail.com> wrote:
> Jarmo, the code you suggested is working in Watir 1.8.6. It is not
> working in Watir 1.9.2. Watir 1.9.2 says unable to locate using row
> index 1.
>
> I found that
> ie.frame(:id,"body").table(:id,"recordListButton_UserList_ctl00").click_no_wait
> is working with Watir 1.9.2. I don't understand why
> ie.frame(:id,"body").table(:id,"recordListButton_UserList_ctl00")[1]
> [2].click_no_wait does not work in Watir 1.9.2. I can replace
> "table(:id,"recordListButton_UserList_ctl00")[1][2]" in my code with
> "table(:id,"recordListButton_UserList_ctl00")". But i would like to
> know if there is a solution for this problem. Because if i had to
> replace like this i need to do it in lot many places.
>
> As i described earlier the error message says "Undefined method `each'
> for :ole_object:Symbol (NoMethodError)". I am not using each method
> anywhere in my code. This looks like an issue with Watir 1.9.2?
>

Are you SURE you are really comparing watir 1.8.6 (which is not a
version I see in the change list) with watir 1.9.2 ?

I ask because all the info you provided above says Watir 2.0.4 NOT
1.9.2

See my response on StackOverflow
http://stackoverflow.com/questions/8069798/undefined-method-each-for-ole-objectsymbol/8073815#8073815
Message has been deleted

sridhar

unread,
Nov 10, 2011, 12:41:10 PM11/10/11
to Watir General
No.. i am not comparing Watir 1.8.6 with Watir 1.9.2. I am comparing
between Ruby 1.8.6 (has wartir 1.7.1) with Ruby 1.9.2 (has watir
2.0..4).

We finally got the answer for it. it is the indexing problem. In
Watir
2.0 and later the array index starts from 0. The index starts with 1
in older versions of watir. This blog (http://watir.com/2011/08/11/
watir-2-0/) also has some more info on Watir 2.0.

So, when i try
ie.frame(:id,"body").table(:id,"recordListButton_UserList_ctl00")[0]
[1].click_no_wait instead of
ie.frame(:id,"body").table(:id,"recordListButton_UserList_ctl00")[1]
[2].click_no_wait it works.




Thanks you all. :)



On Nov 9, 6:05 pm, Chuck van der Linden <sqa...@gmail.com> wrote:
> On Nov 9, 3:10 pm, sridhar <sridhar...@gmail.com> wrote:
>
>
>
>
>
> > Jarmo, the code you suggested is working in Watir 1.8.6. It is not
> > working in Watir 1.9.2. Watir 1.9.2 says unable to locate using row
> > index 1.
>
> > I found that
> > ie.frame(:id,"body").table(:id,"recordListButton_UserList_ctl00").click_no_­wait
> > is working with Watir 1.9.2. I don't understand why
> > ie.frame(:id,"body").table(:id,"recordListButton_UserList_ctl00")[1]
> > [2].click_no_wait does not work in Watir 1.9.2. I can replace
> > "table(:id,"recordListButton_UserList_ctl00")[1][2]" in my code with
> > "table(:id,"recordListButton_UserList_ctl00")". But i would like to
> > know if there is a solution for this problem. Because if i had to
> > replace like this i need to do it in lot many places.
>
> > As i described earlier the error message says "Undefined method `each'
> > for :ole_object:Symbol (NoMethodError)". I am not using each method
> > anywhere in my code. This looks like an issue with Watir 1.9.2?
>
> Are you SURE you are really comparing watir 1.8.6 (which is not a
> version I see in the change list) with watir 1.9.2 ?
>
> I ask because all the info you provided above says Watir 2.0.4   NOT
> 1.9.2
>
> See my response on StackOverflowhttp://stackoverflow.com/questions/8069798/undefined-method-each-for-...- Hide quoted text -

Jarmo Pertman

unread,
Nov 10, 2011, 1:34:52 PM11/10/11
to Watir General
Cool, although better error message would become handy :) Can you
create an issue in jira? [1]

[1] http://jira.openqa.org/browse/WTR

Jarmo
> > See my response on StackOverflowhttp://stackoverflow.com/questions/8069798/undefined-method-each-for-...Hide quoted text -

Chuck van der Linden

unread,
Nov 10, 2011, 3:54:40 PM11/10/11
to Watir General
On Nov 10, 10:34 am, Jarmo Pertman <jarm...@gmail.com> wrote:
> Cool, although better error message would become handy :) Can you
> create an issue in jira? [1]
>
> [1]http://jira.openqa.org/browse/WTR
>
> Jarmo
>

http://jira.openqa.org/browse/WTR-494

Željko Filipin

unread,
Nov 11, 2011, 4:37:03 AM11/11/11
to watir-...@googlegroups.com
On Thu, Nov 10, 2011 at 9:54 PM, Chuck van der Linden <sqa...@gmail.com> wrote:
> http://jira.openqa.org/browse/WTR-494

Upvoted the ticket.

Željko
--
watir.com - community manager
watir.com/book - author
watirpodcast.com - host
Reply all
Reply to author
Forward
0 new messages