Watir question regarding Span

hi,
I have the following error while I was running the watir scripts.

when I run the line given below

vActual=$browser.span("CLI-ID[#{i}]").text

It throws the following error

can't convert String into Hash
    from
C:/Ruby187/lib/ruby/gems/1.8/gems/watir-classic-3.0.0/lib/watir-classic/supported_elements.rb:36:in
`merge'
    from
C:/Ruby187/lib/ruby/gems/1.8/gems/watir-classic-3.0.0/lib/watir-classic/supported_elements.rb:36:in
`format_specifiers'
    from (eval):3:in `span'

Can You please suggest me what kind of error is this?

RAJ

···

--
Posted via http://www.ruby-forum.com/.

The message literally says that "You are passing a String when it's
expected to receive a Hash".

What is CLI-ID[{#i}] ?

How is the span html line?

Something like:

<span id="CLI-ID[3]">Text under span</span>

???

If so, you should call it like
v_actual = $browser.span(:id => "CLI-ID[#{i}]").text

Tip: Cheat Sheet · watir/watir Wiki · GitHub

Abinoam Jr.

···

On Wed, Jan 8, 2014 at 9:08 PM, Raja gopalan <lists@ruby-forum.com> wrote:

hi,
I have the following error while I was running the watir scripts.

when I run the line given below

vActual=$browser.span("CLI-ID[#{i}]").text

It throws the following error

can't convert String into Hash
    from
C:/Ruby187/lib/ruby/gems/1.8/gems/watir-classic-3.0.0/lib/watir-classic/supported_elements.rb:36:in
`merge'
    from
C:/Ruby187/lib/ruby/gems/1.8/gems/watir-classic-3.0.0/lib/watir-classic/supported_elements.rb:36:in
`format_specifiers'
    from (eval):3:in `span'

Can You please suggest me what kind of error is this?

RAJ

--
Posted via http://www.ruby-forum.com/\.

hi Abinoam Jr.,

Thank you.

···

--
Posted via http://www.ruby-forum.com/.

You're welcome!

···

On Wed, Jan 8, 2014 at 11:41 PM, Raja gopalan <lists@ruby-forum.com> wrote:

hi Abinoam Jr.,

Thank you.

--
Posted via http://www.ruby-forum.com/\.