# you were trying to use an undefined local variable in your test method # here is an example that uses an instance variable for IE # the test runs, but fails -- I don't know what you are looking for :-)
require 'watir' require 'test/unit' require 'test/unit/ui/console/testrunner' require 'watir/testUnitAddons' class TC_Fields < Test::Unit::TestCase include Watir def setup puts "Set URL variable" test_site = 'http://www.yahoo.com' puts "Start New Browser" @ie = IE.new puts "Setup: go to the test site: " + test_site @ie.goto(test_site) #puts "Assertion Test in Position A" #assert(@ie.text_field(:id, "v1").exists?) end def test1 puts "Assertion Test in Position B" assert(@ie.text_field(:id, "v1").exists?) end end -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] Sent: Tuesday, August 30, 2005 8:55 AM To: wtr-general@rubyforge.org Subject: [Wtr-general] Re: Wtr-general Digest, Vol 21, Issue 87 Thanks for your responses! This code is a modified version of the code in textfields_test.rb, so I believe the syntax is accurate. I changed Test1 to test1, which provides the same result. I also removed the $ from the ie and I get this Loaded suite C:/Apps/PowerSeller Test Scripts/carl_textfields_test Started Set URL variable Start New Browser Setup: go to the test site: http://www.yahoo.com Assertion Test in Position B E Finished in 1.082 seconds. 1) Error: test1(TC_Fields): NameError: undefined local variable or method `ie' for #<TC_Fields:0x2b7fb48> C:/Apps/PowerSeller Test Scripts/carl_textfields_test.rb:33:in `test1' 1 tests, 0 assertions, 0 failures, 1 errors My gut is telling me it is something with my development environment. If someone has a moment please copy and execute this script in your environment. Thanks, Carl _______________________________________________ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general _______________________________________________ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general