[Wtr-general] <nil> is not true with assert(ie.contains_text)

Adrian Rutter Adrian.Rutter at tnt.com
Mon Jun 12 09:43:35 EDT 2006


I have a problem with assertions.

If I write this:

require 'watir'
require 'test/unit'
class TC_1 < Test::Unit::TestCase



  def  test_1


    ie = Watir::IE.new
    ie.goto('http://wtr.rubyforge.org/')
    if assert(ie.contains_text("Watir"))
      p 'pass'
    else
      p 'fail'
    end
    rescue => e
      puts(e.message + "\n" + e.backtrace.join("\n"))
    ensure
    ie.close
  end

end


I get a puts 'fail', even though 'Watir' is contained.

If I change the search criteria to: 'ZXV'

I get an exception with this

"Loaded suite C:/Documents and
Settings/g744ahe/workspace/ruby_test/auto_tests/Common_Sales/E2/test
Started
<nil> is not true."

And a backtrace.

I have tried to do search to find the method #contains_text, but I cannot
see it.

Aidy



---------------------------------------------------------------------------------------------------------------
This message and any attachment are confidential and may be privileged or otherwise protected from disclosure. 
If you are not the intended recipient, please telephone or email the sender and delete this message and any attachment from your system.  
If you are not the intended recipient you must not copy this message or attachment or disclose the contents to any other person.
---------------------------------------------------------------------------------------------------------------



More information about the Wtr-general mailing list