If the ñ character is anywhere in my html file, it appears to be
breaking the xpath selectors I'm using.  Here's an example of what I'm
running into.

If I have the following html file:

<html>
        <body>
                <form id="frmNavigate">
                        <input type="hidden" name="name1" value="value1" />
                        <input type="hidden" name="name2" value="value2" />
                </form>
                <div>
                        <div>Español</div>
                </div>
        </body>
</html>

And use this selector:

x = ie.hidden(:xpath, "//inp...@name='name1']")

x.exists? will return this error:

irb(main):203:0> x.exists?
REXML::ParseException: #<REXML::ParseException: Missing end tag for
'div' (got "
body")
Line:
Position:
Last 80 unconsumed characters:
 </HTML> >
C:/Ruby/lib/ruby/1.8/rexml/parsers/baseparser.rb:330:in `pull'
C:/Ruby/lib/ruby/1.8/rexml/parsers/treeparser.rb:22:in `parse'
C:/Ruby/lib/ruby/1.8/rexml/document.rb:205:in `build'
C:/Ruby/lib/ruby/1.8/rexml/document.rb:42:in `initialize'
C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/ie-class.rb:
713:in `new'
C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/ie-class.rb:
713:in `create_rexml_document_object'
C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/ie-class.rb:
693:in `rexml_document_object'
C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/ie-class.rb:
897:in `elements_by_xpath'
C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/ie-class.rb:
890:in `element_by_xpath'
C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/container.rb:
730:in `locate_input_element'
C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/input_elements.rb:
5:in `locate'
C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/element.rb:273:in
`exists?'

(irb):203:in `irb_binding'
C:/Ruby/lib/ruby/1.8/irb/workspace.rb:52:in `irb_binding'
:0
...
Missing end tag for 'div' (got "body")
Line:
Position:
Last 80 unconsumed characters:
 </HTML>
Line:
Position:
Last 80 unconsumed characters:
 </HTML>
        from C:/Ruby/lib/ruby/1.8/rexml/parsers/treeparser.rb:92:in
`parse'
        from C:/Ruby/lib/ruby/1.8/rexml/document.rb:205:in `build'
        from C:/Ruby/lib/ruby/1.8/rexml/document.rb:42:in `initialize'
        from C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/ie-
class.rb:713:in `new'
        from C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/ie-
class.rb:713:in `create_rexml_document_object'
        from C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/ie-
class.rb:693:in `rexml_document_object'
        from C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/ie-
class.rb:897:in `elements_by_xpath'
        from C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/ie-
class.rb:890:in `element_by_xpath'
        from C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/
container.rb:730:in `locate_input_element'
        from C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/
input_elements.rb:5:in `locate'
        from C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/
element.rb:273:in `exists?'
        from (irb):203
        from :0

However, if I remove the ñ and use the same selector, x.exists? will
return true.  I haven't found anything about this issue on the
internet or in this newsgroup.  Is this a known bug and is there a
workaround?  Or am I just missing something?

Thanks for your help!

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~----------~----~----~----~------~----~------~--~---

Reply via email to