Locating element with Hash doesn't work?

6 views
Skip to first unread message

juuser

unread,
Sep 11, 2008, 7:59:33 AM9/11/08
to Watir General
As we all know, then Watir supports multiple attributes also for
finding the element.

So it works like this b.link(:id => 'blah', :index => 1)

So, I'm wondering, why isn't this working
b.link(:id => 'blah')

but you have to use
b.link(:id, 'blah') instead.

Also, input elements doesn't support multiple attributes at the moment
(as I've read then there is hope for these in Watir 1.5.7, right?),
but it would be good if text_field supports at the moment 1 Hash
element, so b.text_field(:id => 'blah') would also work.

Željko Filipin

unread,
Sep 11, 2008, 10:19:17 AM9/11/08
to watir-...@googlegroups.com
On Thu, Sep 11, 2008 at 1:59 PM, juuser <Jar...@gmail.com> wrote:
> So, I'm wondering, why isn't this working
> b.link(:id => 'blah')

You can put feature request in jira:
http://jira.openqa.org/browse/WTR


> Also, input elements doesn't support multiple attributes at the moment
> (as I've read then there is hope for these in Watir 1.5.7, right?),

You can vote for it to be implemented here:
Željko
--
WatirPodcast.com/6

Bret Pettichord

unread,
Sep 11, 2008, 12:04:31 PM9/11/08
to watir-...@googlegroups.com
juuser wrote:
> As we all know, then Watir supports multiple attributes also for
> finding the element.
>
> So it works like this b.link(:id => 'blah', :index => 1)
>
> So, I'm wondering, why isn't this working
> b.link(:id => 'blah')
>
> but you have to use
> b.link(:id, 'blah') instead.
>
>
This is a surprise to me. I just tried this out and it works for me.
Please provide more details on how this isn't working for you.

> Also, input elements doesn't support multiple attributes at the moment
> (as I've read then there is hope for these in Watir 1.5.7, right?),
> but it would be good if text_field supports at the moment 1 Hash
> element, so b.text_field(:id => 'blah') would also work.
>
I agree.

juuser

unread,
Sep 16, 2008, 8:58:17 AM9/16/08
to Watir General
> This is a surprise to me. I just tried this out and it works for me.
Sorry. It seems that I was wrong. I think that I tried with some field
which didn't support multiple attributes and thus it failed. So, it is
working with elements which support multiple attributes but not with
the elements which support only one.

> >Also, input elements doesn't support multiple attributes at the moment
> > (as I've read then there is hope for these in Watir 1.5.7, right?),
> > but it would be good if text_field supports at the moment 1 Hash
> > element, so b.text_field(:id => 'blah') would also work.
>
> I agree.
So, hopefully this will get implemented. Or of course this will get
implemented if multiple attributes support is added to other elements.
Reply all
Reply to author
Forward
0 new messages