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 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: [email protected]
To unsubscribe: [email protected]