Hi
Angrez,
I
haven't been able to spend time on this recently. As you can see from the
details below my setup should be okay
C:\>ruby -vrrexml/rexml -e 'p REXML::Version, PLATFORM'
ruby 1.8.2 (2004-12-25) [i386-mswin32]
"3.1.2.1"
"i386-mswin32"
ruby 1.8.2 (2004-12-25) [i386-mswin32]
"3.1.2.1"
"i386-mswin32"
Given
the following error
c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1922:in `elements_by_xpath':
undefined method `elements' for nil:NilClass
(NoMethodError)
from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1912:in `element_by_xpath'
from G:/workspace/web_pages/trial.rb:3
from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1912:in `element_by_xpath'
from G:/workspace/web_pages/trial.rb:3
This is what's in watir.rb at line
1922
def
elements_by_xpath(xpath)
doc = rexml_document_object()
modifiedXpath = ""
selectedElements = Array.new
doc = rexml_document_object()
modifiedXpath = ""
selectedElements = Array.new
=>
doc.elements.each(xpath) do |element| <= line
1922
modifiedXpath = element.xpath
temp = element_by_absolute_xpath(modifiedXpath)
selectedElements << temp if temp != nil
end
modifiedXpath = element.xpath
temp = element_by_absolute_xpath(modifiedXpath)
selectedElements << temp if temp != nil
end
element.rb seems to be the missing link. I've
tried this file in several locations
C:\ruby\lib\ruby\1.8\rexml
C:\ruby\lib\ruby\1.8\watir\rexml
abnormal program termination
C:\ruby\lib\ruby\site_ruby\1.8\rexml
C:\ruby\lib\ruby\site_ruby\1.8\watir\rexml
I've read the code and see where rexml/document
gets loaded. If create_rexml_document_object does its thing then how can the
elements be missing?
Any
ideas?
Regards
Chris
p.s.
I've just
tried v 1.8.4 of Ruby and get the following
c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1755: [BUG]
Segmentation fault
ruby 1.8.4 (2005-12-24) [i386-mswin32]
ruby 1.8.4 (2005-12-24) [i386-mswin32]
abnormal program termination
-----Original Message-----
From: Angrez Singh [mailto:[EMAIL PROTECTED]
Sent: Friday, March 03, 2006 4:30 PM
To: wtr-general@rubyforge.org
Subject: Re: [Wtr-general] xpath support doesn't work for meHi Chris,What version of Ruby are you running?
I am using Ruby 1.8.2 and latest watir tar ball. Also REXML version is "3.1.2.1". You can check this by using following command:
ruby -vrrexml/rexml -e 'p REXML::Version, PLATFORM'
But still I have no clue of what is going wrong?
Regards,
Angrez
_______________________________________________ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general