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:informat_specifiers’
from (eval):3:in `span’

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

RAJ

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:

Text under 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.

hi Abinoam Jr.,

Thank you.

You’re welcome!