Hello
I have the following input fields
<input type="text" readOnly="readonly" value="RKmFFz5H"/>
<input type="text" readOnly="readonly" value="t77Gty2G"/>
<input type="text" readOnly="readonly" value="npWX8NNy"/>

and since there is no html id or name, I'm using xpath to find the 2nd input
field

here is my xpath expression that I'm using
//input[@type='text'][1]

here is some of the code
$edit_descriptions["pwd"] = { "xpath" => "//input[@type='text'][1]"  }
puts @b.text_field($edit_descriptions["pwd"]).value

This is the exception I'm getting

---------- ruby.exe ----------
D:/Ruby186/lib/ruby/gems/1.8/gems/watir-1.8.1/lib/watir/locator.rb:175:in
`match?': xpath is an unknown way of finding an <INPUT> element
(//input[@type='text'][1])
(Watir::Exception::MissingWayOfFindingObjectException)
from
D:/Ruby186/lib/ruby/gems/1.8/gems/watir-1.8.1/lib/watir/locator.rb:28:in
`match_with_specifiers?'
from
D:/Ruby186/lib/ruby/gems/1.8/gems/watir-1.8.1/lib/watir/locator.rb:26:in
`each'
from
D:/Ruby186/lib/ruby/gems/1.8/gems/watir-1.8.1/lib/watir/locator.rb:26:in
`match_with_specifiers?'
from
D:/Ruby186/lib/ruby/gems/1.8/gems/watir-1.8.1/lib/watir/locator.rb:163:in
`locate'
from
D:/Ruby186/lib/ruby/gems/1.8/gems/watir-1.8.1/lib/watir/locator.rb:154:in
`each'
from
D:/Ruby186/lib/ruby/gems/1.8/gems/watir-1.8.1/lib/watir/locator.rb:154:in
`locate'
from
D:/Ruby186/lib/ruby/gems/1.8/gems/watir-1.8.1/lib/watir/container.rb:865:in
`locate_input_element'
from
D:/Ruby186/lib/ruby/gems/1.8/gems/watir-1.8.1/lib/watir/input_elements.rb:5:in
`locate'
from
D:/Ruby186/lib/ruby/gems/1.8/gems/watir-1.8.1/lib/watir/element.rb:55:in
`assert_exists'
from (eval):2:in `value'
#<Watir::TextField:0x4e40b00 located=false
how={"xpath"=>"//input[@type='text'][1]"} what=nil>

Output completed (6 sec consumed) - Normal Termination


Any ideas on where I'm going wrong with my xpath expression (I've looked at
the example unittests also) or is there another solution to my problem?


Basim

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

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com

Reply via email to