Title: undefined method `add_assertion' for nil:NilClass

Hello watir team,

I tried to use assertion's in my code and had absolutely now success today. I always get following error:

TEST FAILED.undefined method `add_assertion' for nil:NilClass
c:/ruby/lib/ruby/1.8/test/unit/testcase.rb:115:in `add_assertion'
c:/ruby/lib/ruby/1.8/test/unit/assertions.rb:353:in `_wrap_assertion'
c:/ruby/lib/ruby/1.8/test/unit/assertions.rb:38:in `assert'
./utils.rb:1376:in `bpVerifyOnPage'

Here is a code snipe (verify is a string that is passed to a function):

The if statement works fine. The assert gives me trouble. Why? What is wrong? What is the nil class?
  class BPUtils  < Test::Unit::TestCase

    def initialize
    end

    def
     .........some code
       begin
           assert($ie.contains_text( verify ) )
           puts("TEST PASSED. Found test string #{verify}")
       
          #if $ie.contains_text( verify ) then
                  #   some           
          #else
                      #   some code
            #end             
  
       rescue  => e
        puts("TEST FAILED." + e.message + "\n" + e.backtrace.join("\n"))          
         
        # hand exception over to main program to quit the program
                raise QuitProgram, "quit program", caller
       end
end

_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general

Reply via email to