Hi there,

I'm not sure how many text fields are on the page, but have you
considered using the :index attribute?

@ie.text_field(:index, 5).set "something"


On May 6, 12:07 pm, Felipe Pedrini <felipedr...@gmail.com> wrote:
> Hello, FK,
>
> Yes, it was I thought, a bug, but I came ask here just to confirm.
>
> I've tried the workaround, and I have no success. The error continues:
>
> D:/ruby/lib/ruby/gems/1.8/gems/firewatir-1.6.5/lib/firewatir/
> element.rb:907:in `assert_exists': Unable to locate element,
> using :xpath, "//*...@tabindex='4901']"
>  (Watir::Exception::UnknownObjectException)
>
> And, yes, my tabindex is unique. Do you have any other sugestion? I'm
> not a specialist in xpath queries.
>
> Thanks!
>
> On 6 maio, 15:42, Felipe Knorr Kuhn <fkn...@gmail.com> wrote:
>
>
>
>
>
> > Hello, Felipe,
>
> > It sure does look like a bug.
>
> > A workaround would be using the wildcard selector like this:
>
> > @ie.text_field(:xpath, "//*...@tabindex='4901']").set "test"
>
> > Hopefully your tabindex property is unique to all elements :)
>
> > Regards,
>
> > FK
>
> > On Thu, May 6, 2010 at 2:55 PM, Felipe Pedrini <felipedr...@gmail.com>wrote:
>
> > > Hi guys,
>
> > > I'm evaluating Watir, and I'm trying to simple get an element using
> > > its XPath. But I'm having a problem.
>
> > > First look at the problem.
>
> > > I have the following element in my page:
>
> > > <input type="text" maxlength="15" tabindex="4901">
>
> > > Notice that it doesn't have name neither id attributes. When I try to
> > > get it using xpath:
>
> > > browser.text_field(:xpath, "//
> > > inp...@tabindex='4901']").set("something")
>
> > > I get the following error:
>
> > > D:/ruby/lib/ruby/gems/1.8/gems/firewatir-1.6.5/lib/firewatir/
> > > element.rb:907:in `assert_exists': Unable to locate element,
> > > using :xpath, "//
> > > inp...@tabindex='4901']" (Watir::Exception::UnknownObjectException)
> > >        from D:/ruby/lib/ruby/gems/1.8/gems/firewatir-1.6.5/lib/
> > > firewatir/elements/text_field.rb:149:in `set'
> > >        from waitir_adm_jp_1.rb:10
>
> > > Watir can't find the element. But if I try to get other element that
> > > have id or name attributes using xpath (in the very same page) I can
> > > get it, without problems.
>
> > > My guess is that Watir can't acess elements without name or id
> > > attribute, even if it isn't used in xpath query, the element must have
> > > it. Is it right? If not, where am I making mistake?
>
> > > Thanks.
>
> > > --
> > > Before posting, please readhttp://watir.com/support. In short: search
> > > before you ask, be nice.
>
> > > You received this message because you are subscribed to
> > >http://groups.google.com/group/watir-general
> > > To post: watir-general@googlegroups.com
> > > To unsubscribe: 
> > > watir-general+unsubscr...@googlegroups.com<watir-general%2bunsubscr...@goog
> > >  legroups.com>
>
> > --
> > Before posting, please readhttp://watir.com/support. In short: search 
> > before you ask, be nice.
>
> > You received this message because you are subscribed 
> > tohttp://groups.google.com/group/watir-general
> > To post: watir-general@googlegroups.com
> > To unsubscribe: watir-general+unsubscr...@googlegroups.com
>
> --
> Before posting, please readhttp://watir.com/support. In short: search before 
> you ask, be nice.
>
> You received this message because you are subscribed 
> tohttp://groups.google.com/group/watir-general
> To post: watir-general@googlegroups.com
> To unsubscribe: watir-general+unsubscr...@googlegroups.com

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

You received this message because you are subscribed to 
http://groups.google.com/group/watir-general
To post: watir-general@googlegroups.com
To unsubscribe: watir-general+unsubscr...@googlegroups.com

Reply via email to