Review older
messages again I see that the elements.rb and functions.rb are only supposed to
be copied to C:\ruby\lib\ruby\1.8\rexml. I have done this and restored the
original versions of the files to C:\ruby\lib\ruby\site_ruby\1.8\rexml. Now when
I run my script I get a different error:
Unable to locate
object, using xpath and
//[EMAIL PROTECTED]'Delete']
c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2102:in `assert_exists'
c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2102:in `assert_exists'
-----Original Message-----
From: Greg McShea [mailto:[EMAIL PROTECTED]
Sent: Friday, March 10, 2006 2:57 PM
To: wtr-general@rubyforge.org
Cc: [EMAIL PROTECTED]
Subject: Help with Watir/XPathHi,I've reviewed all the XPath related posts here and am still unable to get a simple statement with xpath _expression_ working. Here is what I have done to setup my installation:1. Installed ruby 1.8.22. Installed watir 1.4.1 using windows installer3. Installed REXML 3.1.33. Downloaded the latest tarball4. Copied TARBALL_HOME\watir\watir.rb to C:\ruby\lib\ruby\site_ruby\1.85. Copied TARBALL_HOME\watir\watir folder to C:\ruby\lib\ruby\site_ruby\1.86. Copied TARBALL_HOME\watir\doc, examples, and unittests folders to c:\watir7. Copied TARBALL_HOME\watir\watir\rexml\elements.rb and functions.rb to C:\ruby\lib\ruby\site_ruby\1.8\rexml and C:\ruby\lib\ruby\1.8\rexmlHere is a snippet of the source I am testing:<DIV style="LEFT: 0px; OVERFLOW: hidden; WIDTH: 655px; POSITION: absolute; TOP: 0px; HEIGHT: 148px"><SPAN style="LEFT: 0px; WIDTH: 655px; POSITION: absolute; TOP: 0px; HEIGHT: 148px"><BUTTON >Add</BUTTON><BUTTON >Delete</BUTTON><BUTTON >Reset</BUTTON></SPAN></DIV>Using "ie.button(:value, 'Delete').click" works fine.The watir Xpath statements I have tried are:ie.button(:xpath, "//button[text()='Delete']").clickie.button(:xpath, "//[EMAIL PROTECTED]'Delete']").clickThese both fail with the error:The undefined method `root_node' for <UNDEFINED> ... </>:REXML::Document
c:/ruby/lib/ruby/site_ruby/1.8/rexml/xpath_parser.rb:154:in `expr'I tried running the xpath_tests unit test but I ran into the problem described here:http://www.mail-archive.com/wtr-general%40rubyforge.org/msg02864.htmlMy application has many instances where there is no unique way to identify elements so using Xpath is a must for me.Any help in getting this working is much appreciated.Thanks,Greg
_______________________________________________ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general